As seen by T253756, it is easy to mistakenly run a maintenance script from the deployment host rather than the maintenance host as their environment is so similar.
For a lot of people these two hosts are the only MediaWik-deployed hosts in production that they have shell access to.
To my knowledge, on a deployment host:
- ... there is no use case for running foreachwiki .
- ... there is one use case for automated/scripted running of mwscript, namely by Scap for generating the localisation cache. This does not need the CLI wrapper, though. I suggest letting scap run php multiversion/MWScript.php directly. That also means Scap is explicitly in control over whether it executes from /srv/medaiwiki or /srv/medaiwiki-staging.
- ... there is one use case for manual invocation of mwscript, namely as part of scap update-interwiki-cache. This has numerous other problems (per T247107), but given that this too is scripted by Scap, it would be trivial to write out the long-form here.
As such, I propose that the following are removed from the deployment host:
- mwscript
- foreachwiki
- foreachwikiindblist
- (any other MWScript wrappers?)
Thus making yielding a very obvious error that these are not available here. Just like when debugging a random app server in production, php MWScript.php can still be called directly ad-hoc if/when absolutely needed for some reason.