Closed (duplicate)
Project:
X Autoload
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Feb 2013 at 16:51 UTC
Updated:
11 Dec 2013 at 12:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
donquixote commentedHere is a patch. Should do the job. But needs some testing!
Comment #2
donquixote commentedComment #3
donquixote commentedOne question would be: Is there any reason to not do this by default? E.g. should we make this optional, so the user needs to enable the feature? I don't really see why, I don't think there could be anything other than the composer stuff in sites/*/vendor/composer/autoload_*.php.
Comment #4
donquixote commentedAnd btw, why not use autoload.php created by composer?
(See also #1433256-20: Proposal: Composer as a Library Manager ff)
Because:
- Performance (1): xautoload has an APC cache, that will also be used for composer. More funky cache mechanics might be added in the future.
- Performance (2): The fewer separate class loaders we register with spl_autoload_register(), the better. (and unlike classloader, xautoload does not get slower with more namespaces)
- Flexibility: It allows to register more than one composer dir, without any duplicate classes being defined.
Caveat:
- Do we know for sure that
composer/autoload_namespaces.phpwill always be provided by composer?- Do we know for sure that
sites/*/vendorwill be the definitive place for composer stuff in D7 ?Comment #5
clemens.tolboomThe order for loading the classes seems ok .. first the all and then overwrite with the site specific. Or is it working the other way around?
The biggest problem lies in version conflicts thus an inconsistent merge over versions.
Comment #6
clemens.tolboomWhy isn't this patch picked-up by the testbot?
Comment #7
clemens.tolboomComment #9
donquixote commentedI think this should be discussed on the Composer manager queue.
#1943536: Integrate with contributed class loader modules