Hi,

You can now use a PSR-4 autoloader[1] in MediaWiki core and via
extension.json.

If you're not familiar with PSR-4, it's a standard which tells
autoloaders that if a class is named Foo\Bar\Baz, it can be found at
$basePath/Bar/Baz.php. This means that we don't need to keep a mapping
of classes to filenames, and instead just need to register the namespace
with the autoloader.

In extension.json, you can register PSR-4 compliant namespaces with the
"AutoloadNamespaces" property[2]. You can also look at the
ContentTranslation, Linter, or ORES extensions for examples.

[1] http://www.php-fig.org/psr/psr-4/
[2]
https://www.mediawiki.org/wiki/Manual:Extension.json/Schema#AutoloadNamespaces

-- Kunal / Legoktm

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to