wiki.techinc.nl/includes/utils
Máté Szabó c04cb6f607 Include core PSR-4 classes in the generated classmap
It appears that autoloading classes via MediaWiki's PSR-4 autoloader has
a not insignificant performance penalty, especially when hundreds of
PSR-4 classes like HookRunner's hook interfaces are autoloaded. Using a
classmap autoloader, like we already do for PSR-4 classes from Composer
dependencies, is a potential way to reduce the performance impact
here.[1]

For core classes, this can be done by simply not excluding PSR-4 classes
in AutoloadGenerator, causing it to include appropriate mappings in the
generated autoload.php classmap. I had to exclude one class_alias()
declared in Result.php from the classmap with a NO_AUTOLOAD stanza,
because including it broke AutoLoaderStructureTest's assertion that all
aliases should be defined in the same file as the aliased class.
Assuming this is still an issue, this would already have been a problem
because the test was previously skipping every PSR-4 class. Excluding
this file via NO_AUTOLOAD just restores that status quo.
----
[1] https://phabricator.wikimedia.org/T274041#8358399

Bug: T274041
Change-Id: I0aa62c944d874bf7a9f3a240e72e58fe6a887b28
2022-11-08 12:13:32 +01:00
..
AutoloadGenerator.php Include core PSR-4 classes in the generated classmap 2022-11-08 12:13:32 +01:00
BatchRowIterator.php SQLPlatform: Introduce buildComparison() 2022-09-10 04:22:19 +02:00
BatchRowUpdate.php
BatchRowWriter.php
ClassCollector.php ClassCollector: Fix mistake in comment for T_DOUBLE_COLON case 2022-06-30 12:01:06 -04:00
ExecutableFinder.php Replace some more usages of Wikimedia\(suppress|restore)Warnings() 2022-02-24 20:27:46 +00:00
FileContentsHasher.php
MWCryptHKDF.php Fix typos in comments (M) 2022-01-09 23:00:20 +05:30
MWCryptRand.php
MWFileProps.php Use short array destructuring instead of list() 2022-10-21 15:33:37 +11:00
MWRestrictions.php Revert "Reorg: Move some of request related classes to MediaWiki/Request" 2022-10-27 13:14:16 +00:00
README
RowUpdateGenerator.php
UIDGenerator.php
UrlUtils.php utils: Fix return doc about false/null for UrlUtils::expand 2022-10-04 22:16:12 +02:00
ZipDirectoryReader.php Use short array destructuring instead of list() 2022-10-21 15:33:37 +11:00
ZipDirectoryReaderError.php

The classes in this directory are general utilities for use by any part of
MediaWiki. They do not favour any particular user interface and are not
constrained to serve any particular feature. This is similar to includes/libs,
except that some dependency on the MediaWiki framework (such as the use of
MWException, Status or wfDebug()) disqualifies them from use outside of
MediaWiki without modification.

Utilities should not use global configuration variables, rather they should rely
on the caller to configure their behaviour.