Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #36335, comment 15


Ignore:
Timestamp:
04/21/2016 04:03:08 PM (9 years ago)
Author:
greg1anderson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36335, comment 15

    initial v1  
    33It is clear that if plugin "A" requires some library version 1.x, and another library requires the same library at version 2.x, that can never work. However, if you implement plugin dependencies by giving each plugin its own autoloader, then you can run into some pretty extreme and hard-to-debug scenarios if you mix the same minor versions (e.g. 1.0.1 and 1.0.2) of the same dependency. The [https://github.com/composer/composer/issues/3852 problem with including different versions of Composer twice] has already been mentioned above, but this same problem can extend to any common library used in any two plugins. For a more complete explanation, see [https://pantheon.io/blog/trouble-two-autoloaders The Trouble with Two Autoloaders].
    44
    5 This problem cannot be solved by implementing your own common autoloader. It can only be solved by having a single autoloader for the entire application -- e.g. a single composer.json at the root of the project, where plugins are added via `composer require`.
     5This problem cannot be solved by implementing your own common autoloader. It can only be solved by having a single autoloader for the entire application -- e.g. a single composer.json ('''EDIT:''' ''misspoke here, see below'') at the root of the project, where plugins are added via `composer require`.