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
Phil:
Even the "example" implementation in the spec body itself suffers the same exact problem.
And you missed my point entirely. My original tweet was that "The reference implementation doesn't allow it ;-)". Which indicated that while Composer does allow multiple paths within a namespace, the reference and example implementations do not. Which indicates that the spec does not allow it. Which indicates that the code that you're claiming to be PSR-0 (which is individually), is not actually PSR-0 when used together. Which also indicates that Composer's autoloader itself is not PSR-0 compliant (even though it claims to be)...
And as far as "and that is not how any vaugely right minded person would ever do it.", be very careful what you say or insinuate. Do you claim to know the requirements and usages for all time going forward? I have run into issues like that before. And I can assure you that if you work at it long enough, you will as well.
That attitude of "If you do it this way, it all works" is the fundamental failure here. I'm not advocating that there shouldn't be standards. I'm not even advocating for generic ones. I'm advocating for logically consistent standards (which PSR-0 is not, based on the number of ways we've proven it fails).
And what I'm advocating for is that people like you who are preaching it, understand what and why you are preaching it. I remember back a few years someone very prominent in the PSR/FIG group saying very publicly "PSR-0 is the only autoloading solution we will ever need". And now we have the proposal for the "package loader" because other requirements and workflows are needed. Sure, hind sight is 20-20, but foresight is usually blind. And how arrogant it is of you to make a statement like that is not how any vaugely right minded person would ever do it. Just because there are other ways of thinking and building doesn't imply that they are "not in the right mind".
The fact remains. You claimed PSR-0 allows mapping multiple directories to a single namespace tree quite fine. I pointed out that there are logical inconsistencies that can prevent it from happening, so in general PSR-0 actually does not allow it. Your case (common prefix, different suffixes) is actually a special case, and is the edge-case here. The general case is that it will fatal error. Which is the problem.