As Drupal is in the process of considering how to restructure code to best leverage the PSR-0 standard, I figured it would be wise to take a quick survey of how some other major projects organize their code bases. This is not a complete rundown of every project, simply roughly comparable notes for those areas Drupal is currently discussing. I am posting it here in the hopes that it will be useful to more than just Drupal.
Note: This is based on one evening's work of poking around. If you work with one of these projects and have more information to provide or want to correct a mistake I made, please do so in the comments!
Cake is not a PHP 5.3 system, but its classes appear to be structured in a very PSR-0-friendly way.
Cake has a top level "lib" directory that is "we wrote this, go away" (similar to /core for Drupal). There's another top-level "vendor" directory that is explicitly for 3rd party stuff. There is also a second Vendor directory for app-specific third party stuff. It looks like that's similar to sites/all/modules vs. sites/default/modules, as Cake can host multiple apps on one install.
Cake stores its unit tests in the src/Cake/Test directory. There is an app/Test directory pre-created to hold application-specific tests.
Symfony-namespaced code lives in /src. Non-Symfony-namespaced code that ships with Symfony is placed in /vendor. Curiously, it is not included in the GitHub repository nor are there git submodules. Instead, there is a vendors.php command line script that git clones the dependent repositories. Essentially it's a manual git submodule setup. I do not understand why.
The documentation (links above) suggests that users should install their own 3rd party dependencies in /vendor as well. I... really don't think that's a good idea. :-)
Symfony namespaces its tests to Symfony\Tests (note the plural), but stores them in a /tests directory, not in /src where Symfony itself goes. They are in a mirroring namespace tree to the code being tested.
Bundles (the closest equivalent to Drupal modules) ship with their own tests in a Tests directory/namespace, below the directory/namespace of the bundle.
Silex has a /src directory that contains Silex itself, the Silex-namespaced classes. Any non-Silex namespaced code (Pimple, Symfony2 components, Doctrine, Monolog, etc. It's actually a very similar list to Symfony the framework.) lives in /vendor. In the development repository they are referenced as git submodules.
Silext namespaces its tests to Silex\Tests (note the plural), but stores them in a /tests directory, not in /src where Silex itself goes.
CodeIgnighter is not a PHP 5.3 PSR-0 framework, so its code is not organized for it. I mention it anyway for completeness.
At the top level are an /application directory for a particular install and a /system directory for CI-provided code. The /system directory appears to be clustered in a way that would likely fit a PSR-0 model fairly easily and contains almost exclusively class-per-file files.
The /application directory is setup as a skeleton of a working application. There is even a directory called third_party, the use of which I presume is as one would expect.
I can't seem to find unit tests in the main repository. There's a custom base class for one, but there doesn't appear to be an obvious place to put system-provided tests nor app-specific tests. Odd. Perhaps I'm missing something.
Zend-namespaced code lives under /library (singular). There's a lot of it. :-) There is also a /modules directory that appears to be for additional 3rd party code components, which have their own /library directory that restarts at a Zend\ namespace. (So /modules/ZendFramework1Mvc/library/Zend/[lots of stuff].)
It's not clear from the code repository if there is a canonical place to put 3rd party libraries that are not Zend modules.
The main framework, as well as each module, has a tests/Zend directory that contains a huge number of test classes, mirroring the path and namespace of the class being tested.
Composer isn't a framework project. It's an application to automate managing dependencies. Although its documentation only hints at it, when you tell composer to resolve and download dependencies for you it will do so and place them all into a vendor/ directory. That does not appear to be configurable.
However, that directory is not the direct root of each package's class tree but the root of the package's download. The exact location within vendor/ where each class tree starts varies with the package. Composer provides its own class loader that has all of that sorted out already for you, but if you have your own class loader then you have to work that out yourself.
|Zend Framework 2||/library||N/A||/modules (seems to require placeholder module?)||/tests, module/X/tests|
And Composer puts everything in /vendor.