[wp-trac] [WordPress Trac] #36335: Next generation: core autoloader proposal

WordPress Trac noreply at wordpress.org
Mon Jun 6 15:48:41 UTC 2016


#36335: Next generation: core autoloader proposal
-----------------------------+-----------------------------
 Reporter:  dnaber-de        |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Future Release
Component:  General          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  2nd-opinion      |     Focuses:
-----------------------------+-----------------------------

Comment (by schlessera):

 > The following example composer.json file scans wp-includes/ and wp-
 admin/ for classes and then dumps a PHP 5.2 compatible autoloader. It then
 copies the generated files to wp-includes/autoloader.

 Yes, this is pretty much the same thing I did in my tests documented here:
 https://www.alainschlesser.com/adding-central-autoloader-wordpress/

 However, I would recommend against moving the autoloader manually, this
 just introduces an unnecessary liability that might cause platform issues.
 I would just let Composer handle that as well, it include platform-
 agnostic filesystem management that is tested on lots of
 platforms/environments.

 My recommendation would be to just go with default Composer behavior (less
 surprises), and have WordPress Core simply assume that classes are
 present. Moving the autoloader into `wp-includes` gives the impression
 that this is Core-specific "source" code, while it is in reality only a
 build-time artifact.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36335#comment:52>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list