The 'runMaintenance' method in DatabaseUpdater is used like this (example from AbuseFilter):
$updater->addExtensionUpdate( [ 'runMaintenance', MigrateActorsAF::class, __DIR__ . '/../../../maintenance/MigrateActorsAF.php', ] );
However, the last parameter ($script) is mostly ignored – it's just printed in the output of update.php, but the script is not actually loaded from the given path.
This is bad for 3 reasons:
- Developers waste their time inputting and maintaining these file paths
- Different extensions specify them differently (CodeSearch) – as absolute path, relative to MW root, relative to extension root, or relative to the current file
- It hides the fact that you need to set up the script class to be loaded via AutoLoader, providing the path here won't work
- We're trying to move away from specifying maintenance scripts by file name (see T99268)
We should mark this parameter as optional and unused, and then remove it from the code and any examples.