wiki.techinc.nl/maintenance
Amir Sarabadani 014bc61006 Remove more indirect calls to IDBAccessObject::READ_* constants
Found via (?<!IDBAccessObject)::READ_

We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.

Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
2024-01-23 15:42:38 +01:00
..
abstractSchemaChanges Use year in temporary user names and restart index each year 2024-01-05 17:14:19 +00:00
archives Add the new block and block_target tables 2024-01-08 14:29:59 +11:00
benchmarks Merge "maintenance: Introduce getReplicaDB() and getPrimaryDB()" 2024-01-20 17:22:48 +00:00
includes maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
language Use namespaced classes 2023-12-11 16:07:18 +01:00
mediawiki.Title maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
postgres Add the new block and block_target tables 2024-01-08 14:29:59 +11:00
sqlite Add the new block and block_target tables 2024-01-08 14:29:59 +11:00
storage maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
.htaccess
addChangeTag.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
addRFCandPMIDInterwiki.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
addSite.php Namespace remaining files in includes/site 2023-12-14 14:57:34 -05:00
attachLatest.php Remove more indirect calls to IDBAccessObject::READ_* constants 2024-01-23 15:42:38 +01:00
blockUsers.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
categoryChangesAsRdf.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
changePassword.php
checkBadRedirects.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
checkComposerLockUpToDate.php libs/composer: Namespace under Wikimedia\Composer 2024-01-13 20:10:25 +00:00
checkDependencies.php
checkImages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
checkUsernames.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupBlocks.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupCaps.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
cleanupEmptyCategories.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupImages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupInvalidDbKeys.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupPageLang.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupPreferences.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupRemovedModules.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupSpam.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupTitles.php Remove more indirect calls to IDBAccessObject::READ_* constants 2024-01-23 15:42:38 +01:00
cleanupUploadStash.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
cleanupWatchlist.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
clearInterwikiCache.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
CodeCleanerGlobalsPass.php
CommandLineInc.php
compareLanguageConverterOutput.php Namespace ParserOutput 2023-12-14 14:57:34 -05:00
compareParserCache.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
compareParsers.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
convertExtensionToRegistration.php libs/composer: Namespace under Wikimedia\Composer 2024-01-13 20:10:25 +00: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 remaining files under includes/deferred 2023-11-22 10:08:53 -05:00
createBotPassword.php Namespace remaining User-related classes under \MediaWiki\User 2023-09-20 09:12:08 +01:00
deleteArchivedFiles.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteArchivedRevisions.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteAutoPatrolLogs.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteBatch.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
deleteDefaultMessages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteEqualMessages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteLocalPasswords.php
deleteOldRevisions.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteOrphanedRevisions.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteSelfExternals.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
deleteTag.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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 Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
dumpLinks.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
dumpTextPass.php
dumpUploads.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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 Namespace remaining files in includes/site 2023-12-14 14:57:34 -05:00
fetchText.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
fileOpPerfTest.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
findBadBlobs.php Migrate some usages of Database::update() to UpdateQueryBuilder 2024-01-17 15:24:45 +00:00
findClasses.php
findDeprecated.php
findMissingActors.php Migrate some usages of Database::update() to UpdateQueryBuilder 2024-01-17 15:24:45 +00:00
findMissingFiles.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
findOrphanedFiles.php Migrate away from $db->makeList in favor of expression builder 2023-11-02 16:40:48 +00:00
fixDefaultJsonContentPages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixDoubleRedirects.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixInconsistentRedirects.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixMergeHistoryCorruption.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixTimestamps.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixUserRegistration.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
formatInstallDoc.php installer: Namespace more installer classes 2024-01-13 23:42:08 +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 maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
importDump.php WikiImporter: Pass Authority for permissions instead of global context 2023-12-11 19:15:11 +01:00
importImages.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
importSites.php Namespace remaining files in includes/site 2023-12-14 14:57:34 -05: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 maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
initSiteStats.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
initUserPreference.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
install.php installer: Namespace more installer classes 2024-01-13 23:42:08 +00: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: Switch validateScriptFile() from JSMinPlus to Peast 2024-01-06 22:33:46 +00: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
manageJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
mcc.php
mctest.php
mergeMessageFileList.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
migrateBlocks.php MigrateBlocks: maintenance script for migrating to multiblocks schema 2024-01-11 14:45:29 +11:00
migrateExternallinks.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
migrateFileRepoLayout.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
migrateLinksTable.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
migrateRevisionActorTemp.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
migrateRevisionCommentTemp.php Migrate some usages of Database::update() to UpdateQueryBuilder 2024-01-17 15:24:45 +00:00
migrateUserGroup.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
moveBatch.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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 Remove more indirect calls to IDBAccessObject::READ_* constants 2024-01-23 15:42:38 +01:00
nukeNS.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
nukePage.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
pageExists.php
parse.php Namespace ParserOutput 2023-12-14 14:57:34 -05:00
patchSql.php installer: Namespace remaining classes 2024-01-13 23:45:14 +00:00
populateBacklinkNamespace.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateChangeTagDef.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateFilearchiveSha1.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateImageSha1.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateInterwiki.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateIpChanges.php Migrate remaining Database::insert calls to InsertQueryBuilder 2023-12-22 14:53:17 +01:00
populatePPSortKey.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateRecentChangesSource.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02:00
populateRevisionLength.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateRevisionSha1.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
prewarmParsoidParserCache.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
protect.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
pruneFileCache.php
pruneUnusedLinkTargetRows.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
purgeChangedFiles.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
purgeChangedPages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
purgeMessageBlobStore.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
purgeModuleDeps.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01: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 maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
rebuildall.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
rebuildFileCache.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
rebuildImages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
rebuildLocalisationCache.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
rebuildmessages.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
rebuildrecentchanges.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
rebuildtextindex.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
recountCategories.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
refreshFileHeaders.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
refreshImageMetadata.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
refreshLinks.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
removeInvalidEmails.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
removeUnusedAccounts.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
renameDbPrefix.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
renameRestrictions.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
renameUser.php Namespace remaining User-related classes under \MediaWiki\User 2023-09-20 09:12:08 +01:00
renameUsersMatchingPattern.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
renderDump.php WikiImporter: Pass Authority for permissions instead of global context 2023-12-11 19:15:11 +01:00
resetAuthenticationThrottle.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
resetPageRandom.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
resetUserEmail.php Maintenance: use getServiceContainer() method 2023-10-13 10:19:26 +02:00
rollbackEdits.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
run
run.php
runBatchedQuery.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
runJobs.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
runScript.php
shell.php Fix type hint in shell.php 2024-01-22 14:20:05 +01:00
showJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
showSiteStats.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
sql.php installer: Namespace remaining classes 2024-01-13 23:45:14 +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: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
tables-generated.sql Add the new block and block_target tables 2024-01-08 14:29:59 +11:00
tables.json Reword documentation for user.user_is_temp to clarify purpose 2024-01-19 20:00:05 +00:00
tables.sql
undelete.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
update-keys.sql
update.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
updateArticleCount.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
updateCollation.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
updateCredits.php Replace substr with cleaner string methods 2023-05-20 15:40:21 +02:00
updateExtensionJsonSchema.php
updateRestrictions.php maintenance: Migrate to expression builders 2024-01-17 20:27:08 +01:00
updateSearchIndex.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
updateSpecialPages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
uppercaseTitlesForUnicodeTransition.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
userOptions.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
validateRegistrationFile.php
Version.php maintenance/version: Namespace and rename 2023-12-21 11:50:44 +00:00
view.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
wikiBirthday.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
wrapOldPasswords.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +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.