HomePhabricator

Enable using PSR-4 autoloader for MediaWiki core and extensions

Description

Enable using PSR-4 autoloader for MediaWiki core and extensions

This adds support for a PSR-4 (http://www.php-fig.org/psr/psr-4/)
autoloader, so instead of needing to manually list each class, just the
namespace prefix is needed.

Extensions can set a "AutoloadNamespaces" property in extension.json to
register PSR-4 compatible namespaces to be autoloaded.

The implementation is based off of the example implementation
(http://www.php-fig.org/psr/psr-4/examples/) with some modifications
for performance, notably cutting down on function calls, and only trying
to look up classes that are namespaced.

The generateLocalAutoload.php script will ignore any directory that is
registered as a PSR-4 namespace.

Bug: T99865
Bug: T173799
Change-Id: Id095dde37cbb40aa424fb628bd3c94e684ca2f65

Details

Provenance
LegoktmAuthored on Aug 24 2017, 6:05 PM
tstarlingCommitted on Dec 12 2017, 12:20 AM
Parents
rMW09112df01542: Localisation updates from https://translatewiki.net.
Branches
Unknown
Tags
Unknown
ChangeId
Id095dde37cbb40aa424fb628bd3c94e684ca2f65