A native implementation of PSR-0 using only the autoloader from the PSR-0 example in the spec would expect a folder structure like this:
League\Oauth2\Client\Foo = myapp/somefolder/League/Oauth2/Client/Foo.php
League\Oauth2\Server\Bar = myapp/somefolder/League/Oauth2/Server/Bar.php
If I was making these as packages, I could make them into two packages, which would be installed in different locations, because thats how Composer rolls:
League\Oauth2\Client\Foo = myapp/vendor/league/oauth2/src/League/Oauth2/Client/Foo.php
League\Oauth2\Server\Bar = myapp/vendor/league/oauth2-server/src/League/Oauth2/Server/Bar.php
Well,
That last line will produce a fatal error, as the first loader will attempt to
require
the file:myapp/vendor/league/oauth2/src/League/Oauth2/Server/Bar.php
, which doesn't exist.You could work around this, and define sub-namespaced loaders:
But that quickly becomes untenable, as it precludes anything higher than the common NS mount (anything higher will cause fatal errors again, as the loader is always recursive).
For example:
Cannot exist in separate directory trees ever with the reference implementation identified by PSR-0.