[wp-trac] [WordPress Trac] #47256: Use composer to install and update external PHP libraries
WordPress Trac
noreply at wordpress.org
Mon May 13 18:23:42 UTC 2019
#47256: Use composer to install and update external PHP libraries
--------------------------------+-----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: External Libraries | Version: 5.2
Severity: normal | Keywords: needs-patch
Focuses: coding-standards |
--------------------------------+-----------------------------
As of WordPress 5.2, the minimum version of PHP requires was changed to
5.6. This opens up some options around how PHP dependencies can be
managed. [https://getcomposer.org/ Composer] is a popular PHP dependency
manager similar to npm or yarn for javascript. WordPress core has support
already got [https://github.com/WordPress/wordpress-
develop/commit/39a145e0e1e442b4bed8921029c86800a804af60#diff-
b5d0ee8c97c7abd7e3fa29b9a27d1780 support for composer] since 4.7. Since
5.0, many of the javascript dependancies are now loaded in using npm, php
should have a similar build step.
Here are a list of dependancies that could be loaded in using composer.
- [https://github.com/JamesHeinrich/getID3 ID3]
- [https://github.com/rmccue/Requests Requests]
- [https://github.com/LeoColomb/pomo Pomo]
- [https://github.com/simplepie/simplepie SimplePie]
- [https://github.com/paragonie/sodium_compat sodium_compat]
- [https://github.com/paragonie/random_compat random_compat]
- [https://github.com/pear/Text_Diff Text_Diff]
If there are modification to these library in core, these libraries should
be forked and maintained outside of core. Composer has a custom install
path feature, that may allow us to maintain the current file structure.
However, it may mean creating a new vendor directory (wp_vendor) and use
autoloading.
Loading composer these via composer will remove a lot of the bloat of the
code case, will make it easier for the core to manage updates in the
future.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47256>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list