https://bugzilla.redhat.com/show_bug.cgi?id=1173773



--- Comment #5 from Adam Williamson (Fedora) <adamw+fed...@happyassassin.net> 
---
My only real problem with PSR-0ing PSR-4 libraries is, as I said in email, that
we can't entirely rely on them being uniquely named purely by class path, or
about upstream caring if we do wind up hitting collisions (because they'll just
say 'oh, well, it's named by composer vendor'). But if you want to do that, we
can go for it until the problem happens ;) At least PSR-4 requires the classes
to be namespaced, which helps. It may never happen.

"I forget to say, big plus for using a PSR-0 tree, it can be used by PSR-0 and
PSR-4 autoloaders ;)"

As I read it, this isn't strictly true. PSR-4:

"When loading a file that corresponds to a fully qualified class name ...

    A contiguous series of one or more leading namespace and sub-namespace
names, not including the leading namespace separator, in the fully qualified
class name (a "namespace prefix") corresponds to at least one "base
directory"."

It requires "one or more" "namespace and sub-namespace names" to "corresponds
to at least one "base directory". By my reading, loading a class strictly by
class path isn't part of PSR-4, and you could write a PSR-4 autoloader which
didn't do it. The Composer autoloader, which is the one we're going to
encounter most often, (optionally) does, though, of course.

(I agree with you that PSR-4 is a horrible thing, apart from anything else you
could drive a bus through the ambiguities and assumptions in the spec...)

Thanks for the phpab tip, I'd seen that in a spec or two but forgot :) I'll
submit a revised version with PSR-0 layout and phpab loader, and the phpunit
changes (I stole them from a spec I had lying around, as you can probably
guess).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list
package-review@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/package-review

Reply via email to