wiki.techinc.nl/maintenance
Brian Wolff 86608dfd4f Store image sizes as 64-bit bigint instead of 32-bit integers
This is meant in preparation for MediaWiki supporting files
larger than 4gb.

Bug: T191805
Change-Id: Ie67dd01aa0a8b28d9afc1805243e711fcadbc0f8
2023-10-04 08:01:25 -07: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 ResourceLoader: Improve and generalize validateScriptFile test coverage 2023-10-02 18:46:25 -07:00
dev
includes Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00:00
jsduck ResourceLoader: Document the clientPrefs system and make Skin option 2023-08-18 13:32:01 -07: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 Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07: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 another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02: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 Fix some PHPStorm inspections (#1) 2023-03-25 00:19:33 +00:00
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: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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
cleanupUsersWithNoId.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 Maintenance: use getArgs instead of mArgs. 2023-04-03 09:18:38 +00:00
compareLanguageConverterOutput.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +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 Maintenance: use getArgs instead of mArgs. 2023-04-03 09:18:38 +00:00
deleteOrphanedRevisions.php
deleteSelfExternals.php Reorg: Move LinkFilter to ExternalLinks 2023-03-01 22:08:29 +01:00
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 MaintenanceRunner: load script file early if possible 2023-03-14 10:18:29 +01:00
Doxyfile
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 Reorg: Namespace the Title class 2023-03-02 08:46:53 -05: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
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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
findMissingFiles.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
findOrphanedFiles.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
fixDefaultJsonContentPages.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
fixDoubleRedirects.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +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 Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00: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
generateSchemaSql.php
generateSitemap.php generateSitemap: Fix the variant query param 2023-09-27 00:17:04 +08:00
getConfiguration.php Replace usages of MWException 2023-01-29 15:06:26 +01:00
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: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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 Improve default scriptpath in installer.php 2023-05-20 15:50:30 +03: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 Fix even more PHPStorm inspections (#3) 2023-03-25 00:30:15 +00:00
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 Fix some typos 2023-03-21 15:58:09 +01:00
mctest.php
mergeMessageFileList.php mergeMessageFileList.php: Drop support for PHP entry points 2023-05-20 16:42:17 -04:00
migrateExternallinks.php Reorg: Move LinkFilter to ExternalLinks 2023-03-01 22:08:29 +01:00
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 migrateRevisionCommentTemp: Improve select query 2023-01-21 13:28:46 +00: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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
namespaceDupes.php maintenance: Migrate another batch to SelectQueryBuilder 2023-09-21 14:15:42 +02: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 Reorg: Namespace the Title class 2023-03-02 08:46:53 -05:00
parse.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
patchSql.php Maintenance: use getArgs instead of mArgs. 2023-04-03 09:18:38 +00:00
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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
populateRevisionSha1.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
prewarmParsoidParserCache.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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 Update maintenance/README 2023-03-03 10:10:59 -05:00
reassignEdits.php Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00: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 maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00: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 installer: Add database updater for 2008/2011 redirect schema changes 2023-09-21 20:28:13 -07: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 Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00: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
resetUserEmail.php Namespace Sanitizer under \MediaWiki\Parser 2023-09-21 05:39:23 +00:00
rollbackEdits.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
run Fix shebang in maintenance/run: /bin/env -> /usr/bin/env 2023-01-13 14:57:42 +01:00
run.php MaintenanceRunner: load script file early if possible 2023-03-14 10:18:29 +01:00
runBatchedQuery.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
runJobs.php maintenance: Begin using Maintenance::getServiceContainer() 2023-09-04 10:39:58 +00:00
runScript.php Make runScript.php an alias for run.php 2023-01-09 22:44:05 +01:00
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 Store image sizes as 64-bit bigint instead of 32-bit integers 2023-10-04 08:01:25 -07: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.php: Avoid implicit float conversion on modulo 2023-09-20 22:04:46 +02:00
uppercaseTitlesForUnicodeTransition.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00: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 Merge "maintenance: Migrate another batch to SelectQueryBuilder" 2023-09-21 14:03:35 +00: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.