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

WordPress Trac noreply at wordpress.org
Thu Apr 21 16:11:22 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:                   |     Focuses:
-----------------------------+-----------------------------

Comment (by greg1anderson):

 Replying to [comment:16 schlessera]:
 > Yes, there needs to be only 1 single autoloader to get rid of this
 issue. However, there can be as many `composer.json` files as you want (1
 for each dependency). Composer will recursively go through each of them,
 and build up that one true autoloader. So, if you `composer require`  a
 plugin, that plugin's `composer.json` gets parsed and its class
 definitions added to the autoloader automatically.

 Yes, you are absolutely right; thank you for making that correction. Each
 requirement does have its own composer.json file, and there are a number
 of ways these can be brought together, including
 [https://github.com/wikimedia/composer-merge-plugin wikimedia/composer-
 merge-plugin], or something custom such as the
 [https://www.drupal.org/project/composer_manager Composer Manager] module
 that the Drupal project ended up with. I think the best solution, though,
 is to use Composer to build the autoload.php files, exactly as you propose
 in 14.

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


More information about the wp-trac mailing list