The updateCollation.php maintenance script fails to load, showing a PHP error even before displaying help. The error occurs in the constructor.
This was tested under current master branch and REL1_34.
Steps to Reproduce:
Run the updateCollation.php maintenance script with any arguments (no arguments will suffice).
Actual Results:
The following result may differ a bit depending on how exactly you run the script. The following was produced on a Vagrant dev installation, the script was ran using mwscript.
PHP Fatal error: Uncaught Error: Class 'MediaWiki\MediaWikiServices' not found in /vagrant/mediawiki/maintenance/Maintenance.php:621 Stack trace: #0 /vagrant/mediawiki/maintenance/updateCollation.php(47): Maintenance->getConfig() #1 /vagrant/mediawiki/maintenance/doMaintenance.php(48): UpdateCollation->__construct() #2 /vagrant/mediawiki/maintenance/updateCollation.php(336): require_once('/vagrant/mediaw...') #3 /var/www/w/MWScript.php(99): require_once('/vagrant/mediaw...') #4 {main} thrown in /vagrant/mediawiki/maintenance/Maintenance.php on line 621
Expected Results:
Anything but an error :)
Cause:
This script uses the MediaWikiServices class in its constructor before the class is initialized, which causes everything to collapse. To be more precise: the script tries to retrieve the current config setting for
category collation to use it in the help text.
I don't think there is a sensible way around this and it's probably not worth the effort, retrieving the config setting in the constructor is not critical for the execution of the script, so I'd opt for removing it entirely.