Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR-0 compatibility #32

Closed
cyberwolf opened this issue Dec 4, 2011 · 5 comments
Closed

PSR-0 compatibility #32

cyberwolf opened this issue Dec 4, 2011 · 5 comments

Comments

@cyberwolf
Copy link

Partially as a follow-up on #13, do you have any plans on making this library PSR-0 compatible? This would make it a lot easier to use the library in todays common PHP frameworks, and easily install it from a PEAR channel with the PEAR installer.

Really each single class should be moved to a separate file, and a properly structured hierarchy of either PHP 5.3 namespaces or PEAR-style named classes (with each _ in a class name being replaced by the directory separator when autoloading from the file system) established.

I personally would vote for dropping PHP 5.2 compatibility and use PHP 5.3 namespaces. Like this (supposing you might want to use Sabberworm as vendor name, but can be replaced with something else unique):

Sabberworm\CSS\List
Sabberworm\CSS\Document
Sabberworm\CSS\MediaQuery
...
Sabberworm\CSS\Parser

I am willing to help you making this move or do it entirely myself, as this library rocks and I'm eager to make it easier to use it.

@sabberworm
Copy link
Contributor

Great Idea…
I don’t have the time to do this but if you’d like to do it, I’m all for it. And, yes, you also have my support for dropping PHP 5.2.

@nicolopignatelli
Copy link
Contributor

PSR-0 compatibility and Composer support completed. I will make a pull request within today.
https://github.com/nicolopignatelli/PHP-CSS-Parser/tree/PSR-0

@cyberwolf
Copy link
Author

I think there has been some double effort on this as I've been busy as well on PSR-0 compatibility: https://github.com/cyberwolf/PHP-CSS-Parser

@nicolopignatelli
Copy link
Contributor

Don't know... my version is ready out-of-the box for frameworks like Symfony2.
Can you explain why did you choose that directory structure for a simple library?

@cyberwolf
Copy link
Author

I used phix (http://phix-project.org/) which allows for easy creation of PEAR packages as well. What's missing is a composer.json file, but that can be easily added (probably one line difference with yours).

I have no objections though against merging your work instead of mine (which wans't finished yet anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants