wiki.techinc.nl/maintenance
2024-06-18 20:28:09 +00:00
..
abstractSchemaChanges schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
archives schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
benchmarks Rename JsonUnserial… to JsonDeserial… 2024-06-12 14:50:58 -04:00
includes Use namespaced classes (1) 2024-06-16 20:18:23 +02:00
language Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
mediawiki.Title
postgres schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
sqlite schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
storage Use namespaced classes (1) 2024-06-16 20:18:23 +02:00
.htaccess Update Apache config syntax in .htaccess files 2024-03-23 23:36:31 -04:00
addChangeTag.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
addRFCandPMIDInterwiki.php Fix use of ReplaceQueryBuilder::rows 2024-04-01 23:57:03 +02:00
addSite.php Namespace remaining files in includes/site 2023-12-14 14:57:34 -05:00
attachLatest.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
blockUsers.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
categoryChangesAsRdf.php Fix casing of Mediawiki to MediaWiki 2024-01-29 17:15:04 +00:00
changePassword.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
checkBadRedirects.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
checkComposerLockUpToDate.php composer: Remove localization from unlocalizable LockFileChecker 2024-05-30 19:56:29 +01:00
checkDependencies.php
checkImages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
CheckSignatures.php maintenance: Add caller when running query builder 2024-05-31 19:17:36 +02:00
checkUsernames.php maintenance: Add caller when running query builder 2024-05-31 19:17:36 +02:00
cleanupCaps.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
cleanupEmptyCategories.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupImages.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
cleanupInvalidDbKeys.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
cleanupPageLang.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
cleanupPreferences.php Use namespaced classes (1) 2024-06-16 20:18:23 +02: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 Update name & email for bvibber 2024-02-08 17:02:16 -08:00
cleanupUploadStash.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
cleanupWatchlist.php Migrate to IDatabase::newDeleteQueryBuilder 2024-04-12 20:12:05 +02:00
clearInterwikiCache.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
CodeCleanerGlobalsPass.php
CommandLineInc.php
compareLanguageConverterOutput.php [HtmlOutputRendererHelper] Use ParserOutputAccess 2024-06-05 10:37:36 -04: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
convertExtensionsMessagesToTranslationAlias.php Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
convertExtensionToRegistration.php Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
copyFileBackend.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
copyJobQueue.php
createAndPromote.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
createBotPassword.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02: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 allow maintenance/deleteBatch.php to accept page ID 2024-03-27 16:02:44 +00:00
deleteDefaultMessages.php maintenance: Use explicit join in select 2024-05-03 18:26:22 +02: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: Use getServiceContainer() when in instances of Maintenance 2024-02-13 19:25:23 +00:00
deleteTag.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
deleteUserEmail.php
doMaintenance.php
Doxyfile docs: Update obsolete config as of Doxygen 1.9.8 2024-03-27 23:50:23 +00:00
dumpBackup.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
dumpCategoriesAsRdf.php
dumpIterator.php Use namespaced classes (1) 2024-06-16 20:18:23 +02:00
dumpLinks.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
dumpTextPass.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
dumpUploads.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
edit.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
emptyUserGroup.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
eraseArchivedFile.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
eval.php Replace last remaining wfGetDB() calls in core, except ResourceLoader 2024-02-14 11:02:01 -05:00
expireTemporaryAccounts.php expireTemporaryAccounts: Provide support for overriding the expiry period 2024-06-14 15:26:44 +00: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: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
findBadBlobs.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
findClasses.php
findDeprecated.php maintenance: Fix broken strpos in findDeprecated script 2024-01-25 15:46:09 +00:00
findMissingActors.php block: Deprecate and stop using $wgBlockTargetMigrationStage 2024-05-10 15:54:17 +10: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 Add namespace and deprecation alias to JsonContent 2024-05-20 18:57:07 +03:30
fixDoubleRedirects.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
fixInconsistentRedirects.php maintenance: Add caller when running query builder 2024-05-31 19:17:36 +02: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 Update references to config-vars.php 2023-09-23 03:37:44 +00:00
generateJsonI18n.php Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
generateLocalAutoload.php
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 Allow namespaces to be provided via arguments to generateSitemap.php 2024-05-03 18:08:52 +00:00
getConfiguration.php Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
getLagTimes.php maintenance: getLagTimes migrate to StatsFactory 2024-05-15 17:04:14 +00:00
getReplicaServer.php
getText.php
grep.php Add namespace and deprecation alias to TextContent 2024-05-19 23:23:01 +03:30
importDump.php Use namespaced classes (1) 2024-06-16 20:18:23 +02: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 Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
importTextFiles.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
initEditCount.php maintenance: Fix missing where in initEditCount.php 2024-06-16 20:03:25 +00:00
initSiteStats.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
initUserPreference.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
install.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
interwiki.list Propagate changes to Meta map to interwiki.list 2024-05-03 12:59:59 -04:00
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 lag.php: Return replication stopped or errored instead of False 2024-02-27 10:48:49 +00:00
Maintenance.php
Makefile Drop last references to JSDuck 2024-05-01 08:02:42 +01:00
makeTestEdits.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
manageForeignResources.php foreign-resources: Add CycloneDX export support 2024-05-05 15:15:16 +02:00
manageJobs.php fix: use objectcachefactory methods instead of deprecated objectcache methods 2024-05-05 12:40:30 +03:00
mcc.php
mctest.php
mergeMessageFileList.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
migrateBlocks.php rdbms: Warn about queries that don't provide the caller 2024-05-31 22:08:19 +00:00
migrateExternallinks.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
migrateFileRepoLayout.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
migrateLinksTable.php Remove TemplateLinksSchemaMigrationStage config 2024-05-15 22:27:44 +02: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 Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
moveBatch.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
mwdoc-filter.php
mwdocgen.php build: Restore Doxygen output for MediaWiki release tags (take 3) 2024-03-27 19:39:35 +00:00
mysql.php rdbms: Remove ILoadBalancer::getWriterIndex() 2024-06-03 14:17:57 -07:00
namespaceDupes.php maintenance: Check PageLinksSchemaMigrationStage in namespaceDupes.php 2024-05-29 22:21:26 +00:00
nukeNS.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
nukePage.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
pageExists.php
parse.php [maintenance] Add Parsoid support to maintenance/parse.php 2024-02-20 12:16:25 -05:00
patchSql.php installer: Namespace remaining classes 2024-01-13 23:45:14 +00:00
populateBacklinkNamespace.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
populateChangeTagDef.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
populateFilearchiveSha1.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
populateImageSha1.php IReadableDatabase::select cannot return false 2024-04-18 22:48:25 +02:00
populateInterwiki.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateIpChanges.php maintenance: Migrate to IReadableDatabase::newSelectQueryBuilder 2024-04-27 22:28:20 +00:00
populatePPSortKey.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
populateRecentChangesSource.php Use RawSQLValue for some SET clauses in update/upsert 2024-05-29 19:48:09 +00:00
populateRevisionLength.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
populateRevisionSha1.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
populateUserIsTemp.php [temp accounts] Make use of isKnown config flag 2024-06-14 17:26:30 +02:00
prewarmParsoidParserCache.php Move ParsoidOutputAccess::supportsContentModel() into Parsoid SiteConfig 2024-05-22 10:57:37 -04:00
protect.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
pruneFileCache.php
pruneUnusedLinkTargetRows.php maintenance: Add caller when running query builder 2024-05-31 19:17:36 +02: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 block: Deprecate and stop using $wgBlockTargetMigrationStage 2024-05-10 15:54:17 +10:00
purgeExpiredUserrights.php
purgeExpiredWatchlistItems.php
purgeList.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
purgeMessageBlobStore.php
purgeModuleDeps.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
purgeOldText.php
purgePage.php
purgeParserCache.php
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 namespace MWDebug 2024-05-03 22:59:47 +02:00
rebuildImages.php maintenance: Migrate to IReadableDatabase::newSelectQueryBuilder 2024-04-27 22:28:20 +00:00
rebuildLocalisationCache.php Make Maintenance::finalSetup require a SettingsBuilder 2024-01-08 09:40:18 -05:00
rebuildmessages.php
rebuildrecentchanges.php Change some type hints from IDatabase to IReadableDatabase 2024-05-24 16:11:12 +00:00
rebuildtextindex.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
recountCategories.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
refreshFileHeaders.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
refreshImageMetadata.php Replace IDatabase::buildLike with expression builder 2024-05-18 12:29:17 +00:00
refreshLinks.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
removeInvalidEmails.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
removeUnusedAccounts.php block: Deprecate and stop using $wgBlockTargetMigrationStage 2024-05-10 15:54:17 +10:00
renameDbPrefix.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
renameRestrictions.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
renameUser.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
renameUsersMatchingPattern.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
renderDump.php Add dark mode support to plain html outputs 2024-06-09 15:03:14 +03:30
resetAuthenticationThrottle.php User objectCacheFactory methods not deprecated ObjectCache methods 2024-06-06 09:59:24 +01:00
resetPageRandom.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
resetUserEmail.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +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 Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
runScript.php
shell.php fix: use objectcachefactory methods instead of deprecated objectcache methods 2024-05-05 12:40:30 +03:00
showJobs.php
showSiteStats.php Update name & email for bvibber 2024-02-08 17:02:16 -08:00
sql.php rdbms: Remove ILoadBalancer::getWriterIndex() 2024-06-03 14:17:57 -07:00
Sqlite.php
SqliteMaintenance.php maintenance: Use DatabaseSqlite for type-hinting instead of DBConnRef 2024-05-03 17:53:10 +02:00
TableCleanup.php maintenance: Migrate to IReadableDatabase::newSelectQueryBuilder 2024-04-27 22:28:20 +00:00
tables-generated.sql schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
tables.json schema: Drop old pagelinks columns 2024-06-18 21:13:38 +02:00
tables.sql
undelete.php Namespace User under \MediaWiki\User 2023-09-19 19:18:16 +00:00
update-keys.sql
update.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
updateArticleCount.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
updateCollation.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
updateCredits.php
updateExtensionJsonSchema.php Add namespace and deprecation alias to FormatJson 2024-05-16 16:28:01 +03:30
updateRestrictions.php maintenance: Migrate to IDatabase::newUpdateQueryBuilder 2024-04-14 18:47:55 +00:00
updateSearchIndex.php Use expression builder to avoid raw sql via BETWEEN operator 2024-04-21 14:24:21 +02:00
updateSpecialPages.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
uppercaseTitlesForUnicodeTransition.php Maintenance: Print errors from StatusValue objects in a consistent way 2024-06-12 00:07:02 +02:00
userOptions.php [temp accounts] Make use of isKnown config flag 2024-06-14 17:26:30 +02:00
validateRegistrationFile.php
Version.php maintenance/version: Namespace and rename 2023-12-21 11:50:44 +00:00
view.php Add namespace and deprecation alias to TextContent 2024-05-19 23:23:01 +03:30
wikiBirthday.php maintenance: Introduce getReplicaDB() and getPrimaryDB() 2024-01-18 15:12:04 +01:00
wrapOldPasswords.php Use namespaced classes (1) 2024-06-16 20:18:23 +02: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.