[wp-trac] [WordPress Trac] #21300: Implement autoloader compatible with PSR-0 / PSR-4 for plugins and themes

WordPress Trac noreply at wordpress.org
Wed Feb 12 02:53:38 UTC 2014


#21300: Implement autoloader compatible with PSR-0 / PSR-4 for plugins and themes
-----------------------------+------------------------------
 Reporter:  dave1010         |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Bootstrap/Load   |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by MikeSchinkel):

 Oh, and my issue with Composer for plugins and themes is that Composer
 does not map to the problem space that is user-added plugins and themes.
 Composer is about managing shared libraries but WordPress doesn't support
 shared libraries.

 Plus Composer is very strict in its directory layout; it puts everything
 under a ''"vendor"'' directory and that is not how plugins and themes
 store their file, unless we were to ''(optionally)'' have vendor
 directories in each and every plugin and theme.

 OTOH having multiple vendor directories gets around one of the main
 benefits of Composer IMO and that's for Composer to be able to bring in
 **only one** copy of a latest compatible version of a given library even
 though multiple other libraries may reference it. Basically it's the
 [https://en.wikipedia.org/wiki/Highlander_(film) Highlander mantra].

 And that's a problem because as stated above WordPress has no built-in way
 to manage libraries used by multiple plugins/themes, especially when the
 versions used are different but all the function/class name are the same.
 So WordPress plugins/themes really can't use reusable libraries, and
 reusable libraries is what Composer is about. ''(WordPress websites could
 use Composer if you ignore its opinionated directory structure, but that's
 not the use-case being discussed here.)''

 So I don't think we can apply Composer to work with plugin and theme
 dependencies unless and until at least WordPress provides mechanisms to
 share libraries across plugins/themes. I would instead like to see
 WordPress use some of the concepts in Composer to solve the problem in
 it's own WordPress-ish way, including adding a way to share libraries
 across plugins/themes.

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


More information about the wp-trac mailing list