Page MenuHomeDevCentral

Update mw to launch maintenance/run.php
Open, NormalPublic

Description

Recent versions of MediaWiki use a run.php launcher for maintenance scripts.

That means our mw wrapper should run rlwrap php /srv/mediawiki/maintenance/run.php ... instead of directly the relevant script

$ mw update agora

*******************************************************************************
NOTE: Do not run maintenance scripts directly, use maintenance/run.php instead!
      Running scripts directly has been deprecated in MediaWiki 1.40.
      It may not work for some (or any) scripts in the future.
*******************************************************************************

mw is actually a shell script to run the script against the right wiki.

The last line does runs the final command:
https://devcentral.nasqueron.org/source/operations/browse/main/roles/saas-mediawiki/software/files/mw.sh.jinja$103

Event Timeline

dereckson triaged this task as Normal priority.Thu, Nov 6, 19:45
dereckson created this task.
dereckson added a project: good-first-issue.
dereckson moved this task from Backlog to Operations on the Mediawiki SaaS board.
dereckson moved this task from Backlog to Ops on the good-first-issue board.

Until 1.39 it was "php maintenance/update.php", now it's php maintenance/run.php update, so final line is easier:

rlwrap php "$MEDIAWIKI_DIRECTORY/maintenance/run.php" $SCRIPT "$@"

And we also need to remove the check to add ".php" after the script name (e.g. if we wrote mw update agora, $SCRIPT was fixed in update.php
But the "Determine script path" section, as a file exists check is still welcome (just it shouldn't rewrite $SCRIPT).