[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal
WordPress Trac
noreply at wordpress.org
Fri Aug 26 22:06:52 UTC 2016
#36335: Next generation: core autoloader proposal
-----------------------------+------------------
Reporter: dnaber-de | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 4.7
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------
Comment (by JohnPBloch):
Replying to [comment:74 jorbin]:
> Still getting one warning related to the new class loader.
>
> {{{
> Warning: Ambiguous class resolution, "xrstf_Composer52_ClassLoader" was
found in both "/srv/www/ilovewhite.space/public_html/src/wp-
includes/vendor/composer/ClassLoader52.php" and
"/srv/www/ilovewhite.space/public_html/src/wp-includes/vendor/xrstf
/composer-php52/lib/xrstf/Composer52/ClassLoader.php", the first will be
used.
> }}}
That's being caused because the PHP 5.2-compatible autoloader library
copies its own copy of `ClassLoader.php` into the composer-generated
autoload directory. I believe this is related to the point @wonderboymusic
made about keeping `vendor` outside of the directories that composer
searches through for classes to be autoloaded in the classmap.
Evidently you can add a `"exclude-from-classmap"` entry to the autoload
object in composer.json to exclude `wp-includes/vendor` from the classmap,
so I think that would solve both concerns, yes? I'm still looking for
documentation on that key, so I'll update if it doesn't quite work as I
suspect.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:76>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list