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

WordPress Trac noreply at wordpress.org
Fri Aug 26 21:41:11 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 jorbin):

 Replying to [comment:64 wonderboymusic]:
 > Replying to [comment:61 jorbin]:
 > > Some initial thoughts on the proposal:
 > >
 > > 1) Removing the instantiation of things like
 `$GLOBALS['wp_press_this'] = new WP_Press_This(); ` from the original file
 is a breaking change.
 > >
 >
 > Press This was never loaded automatically, it was only loaded whenever
 we are specifically in a Press This enviro: `press-this.php` or one of the
 AJAX callbacks. I feel extremely comfortable making this change, and then
 waiting out the most bizarre of edge cases: someone who built something
 that loads `WP_Press_This` in isolation.

 This is an edgecase, but it is a breaking change.  It needs to be
 documented on make/core as such.

 > > 4) I don't like the additon of the toplevel `vendor` folder.  this
 should go inside wp-includes.
 >
 > Why? To be forward-thinking, we should use the default name and it
 should encompass all classes in the codebase. Hence, be outside of the
 roots the autoloader searches.

 With the number of people who install WordPress in the root of their
 checkout, I can easily see `/vendor` being a conflict. Putting `/vendor`
 inside `/wp-includes` makes it clear that this folder belongs to WordPress
 and also is less likely to run into conflicts.  I've updated the patch
 accordingly.

 >
 > > 5) running `composer install` generates warnings.
 >
 > I feel like I checked that library last year, and we may be using code
 that is no longer maintained ("I might be wrong" - Thom Yorke). If so, we
 should rename those classes. Yes, it is entirely possible that some person
 on this globe is directly using one of those files, not likely though.

 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.
 }}}


 Patch is updated so it applies correctly again. Let's make sure the final
 version soaks for at least 48 hours with the `commit` tag before this
 lands.

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


More information about the wp-trac mailing list