maintenance/mergeMessageFileList.php is used by `scap` to establish a
list of message files to load. To do that, it read extensions paths from
a manually maintained list: wmf-config/extension-list.
This patch adds an optional automatic detection system to add extension
messages. That will reduce the risk of forgetting to update the
extension-list file and will be of good use on labs.
The new parameter is named --extensions-dir and takes a path holding
MediaWiki extensions. The script will take the directory names there and
attempt to load a file named `Foobar/Foobar.php`. --list-file is still
required, you can skip it using /dev/null.
Synopsis:
php maintenance/mergeMessageFileList.php \
--list-file /dev/null \
--extensions-dir /srv/mw-trunk/extensions
Script will bail out whenever an expected PHP file is not found and will
list all of those "missing" files.
Change-Id: I8ab15f899f0333428fd8b2a98c58c07c2fce2962
This reverts commit 5586e73fac.
This broke mergeMessageFileList.php by no longer running the extension
setup files in the global scope.
Change-Id: I8f22d0b3e938ba617f4297802edfc2012d78cc9b
Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild().
Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once().