Does anybody know any larger repositories of high-quality PHP classes and snippets? The only site I know is phpclasses.org, and while I mean no disrespect to its owner/s, its design looks pretty outdated (already has for a looong time) and the "social control" in terms of people reviewing and commenting on code is weak: There are lots and lots of bad code there.
Does anybody know anything in this direction, preferably with Stack Overflow-like interaction possibilities - voting, wiki-style editing, community functions.....?
Update: Starting a bounty to see what's new, out of curiosity. I will award the bounty to any really new, good, and modern suggestion that fulfills at least a part of my requirements above.
Github.com [1], for living code in repositories. After I started using git, I see code just in zipped files for download on the web as dead code and stuff in repositories as live code (more potential). Mainly because live code will have a development history with it, and dead code won't.
In addition, github allows you to easily see how often (if at all) a snippet has been forked, which is usually a useful indicator of quality.
Edit: Just to make that bounty a little more warranted, let me expand on this answer:
Pros of github, and live code repositories:
Cons:
More Pros:
If you're not into learning git, your next best choice is probably going to be mercurial. There are certainly similar sites out there for mercurial. Bitbucket might be a good start. Beyond bitbucket, this question has suggestions for mercurial repository sharing/hosting:
Hosted bug tracking system with mercurial repositories (Summary of options & request for opinions) [3]
TL;DR: Code repositories trump code snapshots every day.
[1] http://github.comThere are some (in order of subjectively percieved coolness):
http://www.codeplex.com/ - recently i found some pearls there, like phplinq or phpexcel ; there are ratings, stats and all that social stuff ;)
https://www.github.com/ with https://gist.github.com/ for little snippets, no ratings (but you can look at followers number)
http://code.google.com/ - no ratings
http://www.ohloh.net/ - also with ratings and community (community orientet de facto), aggregates rather than hosts
http://pear.php.net/ and http://pear2.php.net/ - many dead projects, no ratings
http://sourceforge.net/ - with user recommendations
http://www.phpclasses.org/ - terrible as always, even after retouch of interface, but you have rankings
http://snipplr.com/ (you can see "popular" snippets)
I always look to the Zend Framework, [1] and the Zend Extensions [2]. They are usually very high quality.
[1] http://framework.zend.com/First of all, you might want to consider two different kind of repositories :
In the second category, the first idea that comes to mind would be
pear.php.net
[1] -- but there is a lot of old code, many less-than-well documented libraries, lots of not-maintained stuff, ... Which pretty much means you'll have to go through a lot of stuff and eliminate the bad libraries yourself :-(
Two possible solutions might become interesting -- and they are quite recent :
I've never used those -- but it seems like some kind of repositories anyone can upload packages to ; and those packages can then be installed using the standard PEAR installer.
There doesn't seem to be any kind of voting / reputation / whatever system associated with those, though :-( But it might be interesting to suggest that as a possible improvement ;-)
So, not a real / great answer to your question, actually : there are components and stuff out there -- but the best way to know if something is great is to either test and/or review... And some stuff just lack documentation :-(
In the first category, things might be a bit easier : for lots of frameworks / applications, there are repositories of contributed modules or classes.
For instance, for Zend Framework, this could be interesting :
ZF snippets
[4] (not that much life there either, though...) ; but note that official components of the framework are generally much more useful/better.
And that is probably true for many frameworks out there...
Another example would be Drupal and it's repository of modules [5] -- and, there, you have some sorting by usage possibility, which is a bit of an indication of the quality (generally speaking) of those modules.
[1] http://pear.php.net/RefactorMyCode.com [1], allows people to post a great snippet and others to then improve on it. You can also vote on the improvements. Really fantastic site for beautiful code. [ More info about the site [2]]
Most popular PHP snippets on RefactorMyCode: [ Link [3]]
[1] http://refactormycode.com/www.exorithm.com [1], but it's still in its infancy. As opposed to classes it's centered around functions.
The difference between it and other repositories is that you can run the code right on the server and see the results.
[1] http://www.exorithm.comLet me name three links to make this faux answer eligible.
http://px.sklar.com/ PHP Code Exchange is pretty old, and sufferes from outdated code alike. It's clearly to avoid since there is still PHP3 code ($HTTP_GET_VARS) in it.
http://pearhub.org/projects PEARHub is an independent PEAR repository and shows quite well that it isn't all bad. PEAR in general failed because of inherent complexity. In particular the distributed nature of PEAR repositories (and the difficulty to set them up) doesn't help. It would be an useful ecosystem for PHP if there was a centralised registry. And less bloat.
I also want to harp on the meta topic here. While the question is obviously about an existing and big archive of classes, it might also be a good idea to look out for smaller ones. Also because it makes little sense to dump new and quality code into sites like phpclasses. OTOH it's too frequently overkill to start a project on sourceforge, or even DVCS sites like github or google code. That's IMO the main reason we don't have a coherent or contemporary PHP class repository.
And because this question will surely inspire some SO fella to create something better, finally, let's also term the required attributes. Just opening another upload site isn't going to cut it. The quality miss has technical reasons with social causes.
This answer may not be exactly what you're looking for, but try it out. It's got ratings and difficulty levels, but not very many snippets.
I think your best bet is Google Code and Github repositories, or any project specific repositories. That's how usually find relevant PHP code. Even just browsing them can be fun, there's a lot of nice stuff but it's hard to find.
Nonetheless, lack of documentation is pretty common.
In addition to Zend Framework (mentioned by Byron), also look at EzComponents [1].
[1] http://www.ezcomponents.org/