wiki.techinc.nl/maintenance
Umherirrender baa4ceea55 maintenance: Batch delete for key conflicts in namespaceDupes.php
Limit the deletion of key conflicts for the links table to
$wgUpdateRowsPerQuery rows.

Also use IDatabase::factorConds to build the condiiton

Bug: T350443
Change-Id: I64ec5a01b457a395a1e830c28aabbc2dd3c0f539
2023-11-21 20:32:50 +01:00
..
abstractSchemaChanges Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07:00
archives Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07:00
benchmarks Replace deprecated Linker::formatComment in benchmarkCommentFormatter 2023-10-13 09:44:34 +00:00
dev
includes maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
jsduck resources: Remove jquery.color, jquery.fullscreen, and jquery.form 2023-10-07 01:46:09 +00:00
language maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
mediawiki.Title maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
postgres installer: Fix location of patch-pagelinks-target_id.sql for postgres 2023-11-20 19:11:46 +01:00
sqlite Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07:00
storage maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
.htaccess
addChangeTag.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
addRFCandPMIDInterwiki.php rdbms: Introduce ReplaceQueryBuilder 2023-09-08 11:37:26 +02:00
addSite.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
attachLatest.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
blockUsers.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
categoryChangesAsRdf.php Remove redundant empty() constructs (3) 2023-09-08 23:37:23 +02:00
changePassword.php
checkBadRedirects.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
checkComposerLockUpToDate.php Merge "checkComposerLockUpToDate: Make check that everything is up to date more obvious" 2023-04-25 14:38:07 +00:00
checkDependencies.php
checkImages.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
checkUsernames.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
cleanupBlocks.php
cleanupCaps.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
cleanupEmptyCategories.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
cleanupImages.php Namespace Sanitizer under \MediaWiki\Parser 2023-09-21 05:39:23 +00:00
cleanupInvalidDbKeys.php maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
cleanupPageLang.php Add new maintenance script cleanupPageLang.php 2023-08-05 13:12:42 +00:00
cleanupPreferences.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
cleanupRemovedModules.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
cleanupSpam.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
cleanupTitles.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
cleanupUploadStash.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
cleanupWatchlist.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
clearInterwikiCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
CodeCleanerGlobalsPass.php
CommandLineInc.php
compareLanguageConverterOutput.php Remove incorrect copy-pasted documentation 2023-10-21 03:28:28 +00:00
compareParserCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
compareParsers.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
convertExtensionToRegistration.php Replace substr with cleaner string methods 2023-05-20 15:40:21 +02:00
copyFileBackend.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
copyJobQueue.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
createAndPromote.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
createBotPassword.php Namespace remaining User-related classes under \MediaWiki\User 2023-09-20 09:12:08 +01:00
deleteArchivedFiles.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
deleteArchivedRevisions.php
deleteAutoPatrolLogs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
deleteBatch.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
deleteDefaultMessages.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
deleteEqualMessages.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
deleteLocalPasswords.php
deleteOldRevisions.php Migrate away from $db->makeList in favor of expression builder 2023-11-02 16:40:48 +00:00
deleteOrphanedRevisions.php
deleteSelfExternals.php
deleteTag.php Namespace Sanitizer under \MediaWiki\Parser 2023-09-21 05:39:23 +00:00
deleteUserEmail.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
doMaintenance.php
Doxyfile build: Ignore param-taint and return-taint in Doxyfile 2023-11-08 14:54:24 +00:00
dumpBackup.php
dumpCategoriesAsRdf.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
dumpIterator.php Bump codesniffer to 42.0.0 2023-09-27 15:06:32 -04:00
dumpLinks.php Use getServiceContainer() in maintenance 2023-10-13 13:01:19 +00:00
dumpTextPass.php
dumpUploads.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
edit.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
emptyUserGroup.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
eraseArchivedFile.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
eval.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
expireTemporaryAccounts.php expireTemporaryAccounts: Only process temporary accounts 2023-11-16 17:12:39 +01:00
exportSites.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
fetchText.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
fileOpPerfTest.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
findBadBlobs.php Introduce ArchiveSelectQueryBuilder 2023-09-07 17:03:22 +02:00
findClasses.php
findDeprecated.php
findMissingActors.php Migrate away from $db->makeList in favor of expression builder 2023-11-02 16:40:48 +00:00
findMissingFiles.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
findOrphanedFiles.php Migrate away from $db->makeList in favor of expression builder 2023-11-02 16:40:48 +00:00
fixDefaultJsonContentPages.php maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
fixDoubleRedirects.php Remove allowances for nullable rd_interwiki and rd_fragment 2023-10-03 19:29:55 +02:00
fixInconsistentRedirects.php installer: Add database updater for 2008/2011 redirect schema changes 2023-09-21 20:28:13 -07:00
fixMergeHistoryCorruption.php maintenance: Switch simple calls of Database::select to SQB 2023-07-19 17:42:23 +02:00
fixTimestamps.php
fixUserRegistration.php Maintenance: use getServiceContainer() method 2023-10-13 10:19:26 +02:00
formatInstallDoc.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
generateAutoload.php generateConfigSchema.php: Enable canExecuteWithoutLocalSettings() 2023-07-24 20:25:52 +01:00
generateConfigSchema.php Update references to config-vars.php 2023-09-23 03:37:44 +00:00
generateJsonI18n.php
generateLocalAutoload.php generateLocalAutoload.php: Fix typo 2023-06-26 23:15:19 +01:00
generateSchemaChangeSql.php db: Allow describing table creation via abstract schema change 2023-10-10 20:06:53 -07:00
generateSchemaSql.php db: Allow describing table creation via abstract schema change 2023-10-10 20:06:53 -07:00
generateSitemap.php generateSitemap: Fix the variant query param 2023-09-27 00:17:04 +08:00
getConfiguration.php
getLagTimes.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
getReplicaServer.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
getText.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
grep.php maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
importDump.php importDump: Unconditionally call $importer->setUsernamePrefix() 2023-09-20 13:45:51 +00:00
importImages.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
importSites.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
importSiteScripts.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
importTextFiles.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
initEditCount.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
initSiteStats.php Reorg: Move SiteStats*.php to SiteStats/ 2023-04-27 01:16:29 +02:00
initUserPreference.php In query builders, use insertInto() and deleteFrom() instead of insert() and delete() 2023-09-08 10:16:08 +10:00
install.php maintenance: Remove commented-out code from install.php 2023-11-21 20:06:47 +08:00
interwiki.list
invalidateBotPasswords.php Namespace remaining User-related classes under \MediaWiki\User 2023-09-20 09:12:08 +01:00
invalidateUserSessions.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
jsparse.php ResourceLoader: Improve and generalize validateScriptFile test coverage 2023-10-02 18:46:25 -07:00
lag.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
Maintenance.php
Makefile
makeTestEdits.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
manageForeignResources.php Add ForeignResourceDirs extension/skin attribute 2023-04-25 09:27:35 -04:00
manageJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
mcc.php
mctest.php
mergeMessageFileList.php mergeMessageFileList.php: Drop support for PHP entry points 2023-05-20 16:42:17 -04:00
migrateExternallinks.php
migrateFileRepoLayout.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
migrateLinksTable.php Namespace TitleValue under \MediaWiki\Title 2023-09-18 18:24:39 +01:00
migrateRevisionActorTemp.php
migrateRevisionCommentTemp.php Replace single-value $db->buildComparison() with $db->expr() 2023-10-22 01:05:47 +02:00
migrateUserGroup.php Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00:00
moveBatch.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
mwdoc-filter.php
mwdocgen.php
mwjsduck-gen
mysql.php Update references to renamed DatabaseMySQL class 2023-11-01 11:30:29 -04:00
namespaceDupes.php maintenance: Batch delete for key conflicts in namespaceDupes.php 2023-11-21 20:32:50 +01:00
nukeNS.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
nukePage.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
pageExists.php
parse.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
patchSql.php
populateBacklinkNamespace.php maintenance: Switch simple calls of Database::select to SQB 2023-07-19 17:42:23 +02:00
populateChangeTagDef.php Remove redundant empty() constructs (3) 2023-09-08 23:37:23 +02:00
populateFilearchiveSha1.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateImageSha1.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateInterwiki.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateIpChanges.php Remove redundant empty() constructs (3) 2023-09-08 23:37:23 +02:00
populatePPSortKey.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateRecentChangesSource.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateRevisionLength.php Migrate away from $db->makeList in favor of expression builder 2023-11-02 16:40:48 +00:00
populateRevisionSha1.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
prewarmParsoidParserCache.php Make ParsoidOutputAccess a wrapper over ParserOutputAccess 2023-10-13 15:03:03 -05:00
protect.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
pruneFileCache.php
pruneUnusedLinkTargetRows.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeChangedFiles.php Replace single-value $db->buildComparison() with $db->expr() 2023-10-22 01:05:47 +02:00
purgeChangedPages.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeExpiredBlocks.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeExpiredUserrights.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeExpiredWatchlistItems.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeList.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeMessageBlobStore.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeModuleDeps.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
purgeOldText.php
purgePage.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeParserCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
README
reassignEdits.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
rebuildall.php
rebuildFileCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
rebuildImages.php Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00:00
rebuildLocalisationCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
rebuildmessages.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
rebuildrecentchanges.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
rebuildtextindex.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
recountCategories.php Migrate more calls of Database::select* to SelectQueryBuilder 2023-07-26 13:01:28 +02:00
refreshFileHeaders.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
refreshImageMetadata.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
refreshLinks.php Replace more single-value $db->buildComparison() with $db->expr() 2023-10-22 01:06:04 +02:00
removeInvalidEmails.php Namespace Sanitizer under \MediaWiki\Parser 2023-09-21 05:39:23 +00:00
removeUnusedAccounts.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
renameDbPrefix.php
renameRestrictions.php
renameUser.php Namespace remaining User-related classes under \MediaWiki\User 2023-09-20 09:12:08 +01:00
renameUsersMatchingPattern.php Improve uses of ->where( array_merge( … ) ) in query builders 2023-10-26 19:44:02 +02:00
renderDump.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
resetAuthenticationThrottle.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
resetPageRandom.php Migrate several subqueries to use SQB 2023-10-31 15:54:55 +01:00
resetUserEmail.php Maintenance: use getServiceContainer() method 2023-10-13 10:19:26 +02:00
rollbackEdits.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
run
run.php
runBatchedQuery.php Convert numerous DB queries to use QueryBuilders 2023-10-09 19:06:53 +02:00
runJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
runScript.php
shell.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
showJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
showSiteStats.php maintenance: Switch simple calls of Database::select to SQB 2023-07-19 17:42:23 +02:00
sql.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
Sqlite.php Replace more usages of deprecated MWException 2023-06-08 21:37:07 +00:00
SqliteMaintenance.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
TableCleanup.php maintenance: Switch simple calls of Database::select to SQB 2023-07-19 17:42:23 +02:00
tables-generated.sql Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07:00
tables.json Re-apply "Remove allowances for missing redirect rows" 2023-10-18 23:50:01 +00:00
tables.sql
undelete.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
update-keys.sql
update.php Ensure that installer i18n is loaded by update.php 2023-09-21 15:12:19 -04:00
updateArticleCount.php Reorg: Move SiteStats*.php to SiteStats/ 2023-04-27 01:16:29 +02:00
updateCollation.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
updateCredits.php Replace substr with cleaner string methods 2023-05-20 15:40:21 +02:00
updateExtensionJsonSchema.php
updateRestrictions.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
updateSearchIndex.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
updateSpecialPages.php updateSpecialPages: Call ::waitForReplication() if a host isn't reachable 2023-10-09 12:31:38 +02:00
uppercaseTitlesForUnicodeTransition.php maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00
userOptions.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
validateRegistrationFile.php
version.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
view.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
wikiBirthday.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
wrapOldPasswords.php maintenance: Migrate $db->buildLike() to expression builder 2023-11-06 14:27:03 +01:00

MediaWiki's maintenance scripts are PHP scripts that perform maintenance tasks,
and are designed to be run from the command line.

See also: https://www.mediawiki.org/wiki/Manual:Maintenance_scripts

== Running Maintenance Scripts ==

Maintenance scripts are generally executed using the maintenance runner, calling
''php maintenance/run.php'' followed by the script's name. On most systems, the
shorthand ''maintenance/run'' can also be used. For instance, to run the script
that displays the MediaWiki version, use ''maintenance/run version''.

Maintenance scripts can be called by their simple name, class name, or path.

The simple name corresponds to a file in the maintenance directory:
* ''maintenance/run version'' runs the file ''maintenance/version.php''.

For the class name:
* ''maintenance/run Version'' runs the Version class (using auto-loading from
''./maintenance/version.php'').

For the path:
* ''maintenance/run ./maintenance/version.php'' runs the file
''./maintenance/version.php''.

Note that relative file paths must start with "./". Using this form allows for
the use of tab-completion.

Maintenance scripts defined by extensions may also be called by giving their
full class name or full relative path, such as:
* ''maintenance/run ./extension/AbuseFilter/maintenance/SearchFilters.php''
* ''maintenance/run MediaWiki.Extension.AbuseFilter.Maintenance.SearchFilters''

Note how the dot (".") can be used as a namespace separator instead of the
backslash ("\").

If the extension follows the MediaWiki coding conventions for the location and
namespacing of maintenance scripts, they can be invoked using the name of the
extension, followed by a colon (":") and the name of the script file or class:
* ''maintenance/run AbuseFilter:SearchFilters''

For more details on using the script runner, call ''maintenance/run --help''.

For about an individual script, call ''maintenance/run <script> --help ''.

=== Running Maintenance Scripts before MW 1.40 ===

The maintenance runner described above was introduced in MediaWiki 1.40. In
MediaWiki version 1.39 and earlier, maintenance scripts had to be run as
standalone PHP scripts, by passing the path the the script to the php interpreter.
For instance:

* ''php maintenance/version.php''

This is still possible for most scripts in 1.40, but it will show a deprecation
warning.

== Creating Maintenance Scripts ==

To create a maintenance script, add a PHP file to the maintenance directory that
contains a class that extends the ''Maintenance'' base class and implement
the ''execute()'' method. At the end of the file, add a return statement that
returns the name of the class.

For example, if your class is called ''Frobnify'', place it in a file called
''maintenance/Frobnify.php'' and at the end of the file, put the following
statement:
<pre>
return Frobnify::class;
</pre>

You can now run your script by calling ''maintenance/run Frobnify''.

With this, it will however not be possible to run Frobnify.php as a PHP command
line script. ''php maintenance/Frobnify.php'' will fail with an error.

=== Supporting direct execution of maintenance scripts ===
Since MediaWiki version 1.40, invoking maintenance scripts directly is now
deprecated, and will show a warning even for scripts that support it.

If you need to support direct invocation for your script, this can be
achieved as follows:

At the top of the script file, place the statement:
<pre>
require_once __DIR__ . '/Maintenance.php';
</pre>.

For maintenance scripts defined in extensions, this is slightly more complex:
<pre>
require_once getenv( 'MW_INSTALL_PATH' ) !== false
	? getenv( 'MW_INSTALL_PATH' ) . '/maintenance/Maintenance.php'
	: __DIR__ . '/../../../maintenance/Maintenance.php';
</pre>

Then, at the bottom of the file, replace the return statement with the
following lines:
<pre>
$maintClass = Frobnify::class;
require_once RUN_MAINTENANCE_IF_MAIN;
</pre>

This will allow your script to be executed directly on the PHP command line.
Note however that it will show a warning.