MediaWiki
1.32.5
|
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort. More...
Inherited by AddChangeTag, AddSite, AllTrans, AlterSharedConstraints, AttachLatest, BackupDumper, BackupReader, Benchmarker, BenchmarkParse, CategoryChangesAsRdf, ChangePassword, CheckBadRedirects, CheckComposerLockUpToDate, CheckImages, CheckLess, CheckUsernames, Cleanup, CleanupAncientTables, CleanupArchiveUserText, CleanupBlocks, CleanupInvalidDbKeys, CleanupPreferences, CleanupRemovedModules, CleanupSpam, CleanupUploadStash, ClearInterwikiCache, CLIParser, CommandLineInc, CommandLineInstaller, CompareParserCache, CompressOld, ConvertExtensionToRegistration, ConvertLinks, ConvertUserOptions, CopyFileBackend, CopyJobQueue, CountFancyCaptchas, CreateAndPromote, CreateCommonPasswordCdb, DatabaseLag, DateFormats, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteAutoPatrolLogs, DeleteBatch, DeleteDefaultMessages, DeleteEqualMessages, DeleteLocalPasswords, DeleteOldFancyCaptchas, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteSelfExternals, Digit2Html, DisableOATHAuthForUser, DumpCategoriesAsRdf, DumpIterator, DumpLinks, DumpMessages, DumpRenderer, DumpRev, DumpUploads, EditCLI, EmptyUserGroup, EraseArchivedFile, ExportSites, FakeMaintenance, FetchText, FileOpPerfTest, FindDeprecated, FindHooks, FindMissingFiles, FindOrphanedFiles, FixDoubleRedirects, FixT22757, FixTimestamps, FixUserRegistration, FormatInstallDoc, GenerateCollationData, GenerateFancyCaptchas, GenerateJqueryMsgData, GenerateJsonI18n, GenerateNormalizerDataAr, GenerateNormalizerDataMl, GenerateRandomImages, GetConfiguration, GetLagTimes, GetReplicaServer, GetTextMaint, HHVMMakeRepo, ImageBuilder, ImportImages, ImportSites, ImportSiteScripts, ImportTextFiles, InitEditCount, InitSiteStats, InitUserPreference, InvalidateUserSesssions, JSParseHelper, LangMemUsage, ListVariants, LoggedUpdateMaintenance, MakeTestEdits, ManageForeignResources, ManageJobs, McTest, MediaWikiShell, MergeMessageFileList, MigrateFileRepoLayout, MigrateUserGroup, MinifyScript, MoveBatch, MWDocGen, MwSql, MysqlMaintenance, NamespaceDupes, NukeNS, NukePage, Orphans, OrphanStats, PageExists, ParserEditTests, ParserFuzzTest, ParserTestsMaintenance, PatchSql, PHPUnitMaintClass, PopulateCategory, PopulateContentModel, PopulateContentTables, PopulateInterwiki, Protect, PruneFileCache, PurgeChangedFiles, PurgeChangedPages, PurgeExpiredUserrights, PurgeList, PurgeModuleDeps, PurgeOldText, PurgePage, PurgeParserCache, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildSitesCache, RebuildTextIndex, RecountCategories, RefreshFileHeaders, RefreshImageMetadata, RefreshLinks, RemoveInvalidEmails, RemoveUnusedAccounts, RenameDbPrefix, RenameUserCleanup, ReplaceAll, ResetAuthenticationThrottle, ResetUserEmail, ResetUserTokens, RollbackEdits, RunBatchedQuery, RunJobs, ShowJobs, ShowSiteStats, SqliteMaintenance, StorageTypeStats, SyncFileBackend, TableCleanup, TidyUpT39714, Undelete, Update, UpdateArticleCount, UpdateCollation, UpdateCSS, UpdateDoubleWidthSearch, UpdateExtensionJsonSchema, UpdateLexerList, UpdateMediaWiki, UpdateRestrictions, UpdateScratchTokenFormat, UpdateSearchIndex, UpdateSpecialPages, UserOptionsMaintenance, ValidateRegistrationFile, ViewCLI, and WrapOldPasswords.
Public Member Functions | |
__construct () | |
Default constructor. More... | |
checkRequiredExtensions () | |
Verify that the required extensions are installed. More... | |
cleanupChanneled () | |
Clean up channeled output. More... | |
clearParamsAndArgs () | |
Clear all params and arguments. More... | |
execute () | |
Do the actual work. More... | |
finalSetup () | |
Handle some last-minute setup here. More... | |
getConfig () | |
getDbType () | |
Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB. More... | |
getName () | |
Get the script's name. More... | |
globals () | |
Potentially debug globals. More... | |
isQuiet () | |
loadParamsAndArgs ( $self=null, $opts=null, $args=null) | |
Process command line arguments $mOptions becomes an array with keys set to the option names $mArgs becomes a zero-based array containing the non-option arguments. More... | |
loadSettings () | |
Generic setup for most installs. More... | |
loadWithArgv ( $argv) | |
Load params and arguments from a given array of command-line arguments. More... | |
memoryLimit () | |
Normally we disable the memory_limit when running admin scripts. More... | |
outputChanneled ( $msg, $channel=null) | |
Message outputter with channeled message support. More... | |
purgeRedundantText ( $delete=true) | |
Support function for cleaning up redundant text records. More... | |
runChild ( $maintClass, $classFile=null) | |
Run a child maintenance script. More... | |
setAgentAndTriggers () | |
Set triggers like when to try to run deferred updates. More... | |
setConfig (Config $config) | |
setDB (IDatabase $db) | |
Sets database object to be returned by getDB(). More... | |
setup () | |
Do some sanity checking and basic setup. More... | |
updateSearchIndex ( $maxLockTime, $callback, $dbw, $results) | |
Perform a search index update with locking. More... | |
updateSearchIndexForPage ( $dbw, $pageId) | |
Update the searchindex table for a given pageid. More... | |
Static Public Member Functions | |
static | getTermSize () |
Get the terminal size as a two-element array where the first element is the width (number of columns) and the second element is the height (number of rows). More... | |
static | posix_isatty ( $fd) |
Wrapper for posix_isatty() We default as considering stdin a tty (for nice readline methods) but treating stout as not a tty to avoid color codes. More... | |
static | readconsole ( $prompt='> ') |
Prompt the console for input. More... | |
static | requireTestsAutoloader () |
Call this to set up the autoloader to allow classes to be used from the tests directory. More... | |
static | setLBFactoryTriggers (LBFactory $LBFactory, Config $config) |
static | shouldExecute () |
Should we execute the maintenance script, or just allow it to be included as a standalone class? It checks that the call stack only includes this function and "requires" (meaning was called from the file scope) More... | |
Public Attributes | |
resource | $fileHandle |
Used when creating separate schema files. More... | |
$mDbPass | |
array | $orderedOptions = [] |
Used to read the options in the order they were passed. More... | |
const | DB_ADMIN = 2 |
const | DB_NONE = 0 |
Constants for DB access type. More... | |
const | DB_STD = 1 |
const | STDIN_ALL = 'all' |
Protected Member Functions | |
activateProfiler () | |
Activate the profiler (assuming $wgProfiler is set) More... | |
addArg ( $arg, $description, $required=true) | |
Add some args that are needed. More... | |
addDefaultParams () | |
Add the default parameters to the scripts. More... | |
addDescription ( $text) | |
Set the description text. More... | |
addOption ( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false) | |
Add a parameter to the script. More... | |
adjustMemoryLimit () | |
Adjusts PHP's memory limit to better suit our needs, if needed. More... | |
afterFinalSetup () | |
Execute a callback function at the end of initialisation. More... | |
beginTransaction (IDatabase $dbw, $fname) | |
Begin a transcation on a DB. More... | |
commitTransaction (IDatabase $dbw, $fname) | |
Commit the transcation on a DB handle and wait for replica DBs to catch up. More... | |
countDown ( $seconds) | |
Count down from $seconds to zero on the terminal, with a one-second pause between showing each number. More... | |
deleteOption ( $name) | |
Remove an option. More... | |
error ( $err, $die=0) | |
Throw an error to the user. More... | |
fatalError ( $msg, $exitCode=1) | |
Output a message and terminate the current script. More... | |
getArg ( $argId=0, $default=null) | |
Get an argument. More... | |
getBatchSize () | |
Returns batch size. More... | |
getDB ( $db, $groups=[], $wiki=false) | |
Returns a database to be used by current maintenance script. More... | |
getDir () | |
Get the maintenance directory. More... | |
getOption ( $name, $default=null) | |
Get an option, or return the default. More... | |
getStdin ( $len=null) | |
Return input from stdin. More... | |
hasArg ( $argId=0) | |
Does a given argument exist? More... | |
hasOption ( $name) | |
Checks to see if a particular option exists. More... | |
loadSpecialVars () | |
Handle the special variables that are global to all scripts. More... | |
maybeHelp ( $force=false) | |
Maybe show the help. More... | |
output ( $out, $channel=null) | |
Throw some output to the user. More... | |
requireExtension ( $name) | |
Indicate that the specified extension must be loaded before the script can run. More... | |
rollbackTransaction (IDatabase $dbw, $fname) | |
Rollback the transcation on a DB handle. More... | |
setAllowUnregisteredOptions ( $allow) | |
Sets whether to allow unregistered options, which are options passed to a script that do not match an expected parameter. More... | |
setBatchSize ( $s=0) | |
Set the batch size. More... | |
supportsOption ( $name) | |
Checks to see if a particular option in supported. More... | |
validateParamsAndArgs () | |
Run some validation checks on the params, etc. More... | |
Protected Attributes | |
$mAllowUnregisteredOptions = false | |
$mArgList = [] | |
$mArgs = [] | |
int | $mBatchSize = null |
Batch size. More... | |
$mDbUser | |
$mDescription = '' | |
$mInputLoaded = false | |
$mOptions = [] | |
$mParams = [] | |
$mQuiet = false | |
$mSelf | |
$mShortParamsMap = [] | |
Private Member Functions | |
public function | __construct () |
public function | execute () |
lockSearchindex ( $db) | |
Lock the search index. More... | |
relockSearchindex ( $db) | |
Unlock and lock again Since the lock is low-priority, queued reads will be able to complete. More... | |
setParam (&$options, $option, $value) | |
Helper function used solely by loadParamsAndArgs to prevent code duplication. More... | |
unlockSearchindex ( $db) | |
Unlock the tables. More... | |
Static Private Member Functions | |
static | readlineEmulation ( $prompt) |
Emulate readline() More... | |
Private Attributes | |
$atLineStart = true | |
Config | $config |
Accessible via getConfig() More... | |
$lastChannel = null | |
float | $lastReplicationWait = 0.0 |
UNIX timestamp. More... | |
IMaintainableDatabase | $mDb = null |
Used by getDB() / setDB() More... | |
$mDependantParameters = [] | |
$mGenericParameters = [] | |
array | $requiredExtensions = [] |
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort.
All that must be defined is the execute() method. See docs/maintenance.txt for more info and a quick demo of how to use it.
Definition at line 39 of file maintenance.txt.
Maintenance::__construct | ( | ) |
Default constructor.
Children should call this first if implementing their own constructors
Reimplemented in LoggedUpdateMaintenance, SearchDump, FindDeprecated, CategoryChangesAsRdf, GenerateJqueryMsgData, CLIParser, PurgeChangedFiles, CompressOld, ReplaceAll, BenchmarkTitleValue, ConvertExtensionToRegistration, PopulateContentTables, GenerateCollationData, CleanupInvalidDbKeys, FindHooks, NamespaceDupes, GetConfiguration, DeleteLocalPasswords, ImageBuilder, BenchmarkParse, CleanupWatchlist, MediaWikiShell, PreprocessDump, CleanupCaps, MWDocGen, RefreshImageMetadata, BackupReader, MoveBatch, RebuildTextIndex, CleanupImages, TableCleanup, NukeNS, Benchmarker, DumpRenderer, ShowJobs, CompareParsers, Orphans, UpdateCollation, DumpCategoriesAsRdf, Digit2Html, RebuildRecentchanges, CopyFileBackend, DumpIterator, DumpLinks, GenerateNormalizerDataAr, PopulateLogSearch, CommandLineInc, DeleteBatch, PopulateArchiveRevId, RebuildLocalisationCache, RefreshLinks, ShowSiteStats, UpdateSearchIndex, CleanupUsersWithNoId, ConvertLinks, CreateCommonPasswordCdb, ImportImages, CommandLineInstaller, MergeMessageFileList, PopulateIpChanges, PurgeChangedPages, PurgeParserCache, RecountCategories, GenerateFancyCaptchas, CleanupRemovedModules, TitleCleanup, CleanupUploadStash, ConvertUserOptions, PopulateContentModel, PopulateInterwiki, ResetAuthenticationThrottle, MwSql, UpdateMediaWiki, CountFancyCaptchas, DeleteOldFancyCaptchas, BenchmarkDeleteTruncate, DeleteOrphanedRevisions, FixTimestamps, InvalidateUserSesssions, ReassignEdits, RunJobs, FixT22757, AttachLatest, CheckUsernames, CreateAndPromote, FixDoubleRedirects, GenerateJsonI18n, GenerateNormalizerDataMl, PopulateCategory, PopulateLogUsertext, PopulateRevisionLength, ResetUserTokens, ManageForeignResources, RunBatchedQuery, DumpRev, UpdateArticleCount, UpdateRestrictions, WrapOldPasswords, ParserTestsMaintenance, UpdateScratchTokenFormat, AddChangeTag, BenchHttpHttps, BenchIfSwitch, BenchWfIsWindows, BenchWikimediaBaseConvert, ChangePassword, CleanupPreferences, CopyJobQueue, DeleteArchivedRevisions, EraseArchivedFile, FetchText, FixExtLinksProtocolRelative, ImportTextFiles, DateFormats, LangMemUsage, MigrateActors, MigrateComments, MysqlMaintenance, AlterSharedConstraints, PopulateParentId, PopulateRecentChangesSource, PruneFileCache, PurgeModuleDeps, OrphanStats, UpdateDoubleWidthSearch, UpdateSpecialPages, BenchmarkHooks, CleanupAncientTables, CleanupBlocks, CleanupEmptyCategories, DeleteArchivedFiles, DeleteDefaultMessages, EditCLI, GetLagTimes, GetReplicaServer, GetTextMaint, InitSiteStats, JSParseHelper, DatabaseLag, DumpMessages, McTest, MigrateFileRepoLayout, MinifyScript, NukePage, PopulateExternallinksIndex60, PopulateRevisionSha1, RebuildFileCache, RefreshFileHeaders, RemoveUnusedAccounts, RenameDbPrefix, RollbackEdits, UserOptionsMaintenance, RenameUserCleanup, UpdateCSS, UpdateLexerList, BenchmarkJavaScriptMinifier, BenchmarkJSMinPlus, BenchmarkStringReplacement, CleanupSpam, ClearInterwikiCache, DeleteEqualMessages, DeleteOldRevisions, DeleteSelfExternals, DumpUploads, FileOpPerfTest, FixDefaultJsonContentPages, FixUserRegistration, ImportSiteScripts, AllTrans, ListVariants, MigrateArchiveText, MigrateImageCommentTemp, PatchSql, PopulateFilearchiveSha1, PurgeOldText, RebuildAll, ResetUserEmail, SyncFileBackend, AddRFCandPMIDInterwiki, BenchmarkLruHash, BenchmarkPurge, CheckBadRedirects, CheckImages, FormatInstallDoc, ManageJobs, MigrateUserGroup, PopulateBacklinkNamespace, PopulateImageSha1, Protect, PurgeExpiredUserrights, PurgeList, PurgePage, RebuildMessages, RebuildSitesCache, SqliteMaintenance, ViewCLI, BenchmarkCSSMin, CheckLess, MakeTestEdits, PopulatePPSortKey, BenchmarkSanitizer, CompareParserCache, EmptyUserGroup, InitEditCount, PopulateChangeTagDef, DeleteAutoPatrolLogs, PageExists, Undelete, FindMissingFiles, FindOrphanedFiles, DeduplicateArchiveRevId, ParserEditTests, AddSite, RemoveInvalidEmails, InitUserPreference, ExportSites, ImportSites, PHPUnitMaintClass, Cleanup, ParserFuzzTest, CleanupArchiveUserText, CheckComposerLockUpToDate, DisableOATHAuthForUser, Update, BenchmarkTidy, UpdateExtensionJsonSchema, HHVMMakeRepo, and ValidateRegistrationFile.
Definition at line 161 of file Maintenance.php.
References $IP, and addDefaultParams().
Definition at line 41 of file maintenance.txt.
|
protected |
Activate the profiler (assuming $wgProfiler is set)
Definition at line 796 of file Maintenance.php.
References $output, $wgProfileLimit, $wgProfiler, $wgTrxProfilerLimits, getOption(), Profiler\instance(), and Profiler\replaceStubInstance().
Referenced by finalSetup().
|
protected |
Add some args that are needed.
string | $arg | Name of the arg, like 'start' |
string | $description | Short description of the arg |
bool | $required | Is this required? |
Definition at line 288 of file Maintenance.php.
Referenced by ValidateRegistrationFile\__construct(), UpdateExtensionJsonSchema\__construct(), DisableOATHAuthForUser\__construct(), ImportSites\__construct(), ExportSites\__construct(), AddSite\__construct(), Undelete\__construct(), PageExists\__construct(), EmptyUserGroup\__construct(), Protect\__construct(), ViewCLI\__construct(), MigrateUserGroup\__construct(), FormatInstallDoc\__construct(), PatchSql\__construct(), ResetUserEmail\__construct(), ImportSiteScripts\__construct(), CleanupSpam\__construct(), GetTextMaint\__construct(), UserOptionsMaintenance\__construct(), EditCLI\__construct(), JSParseHelper\__construct(), McTest\__construct(), NukePage\__construct(), ImportTextFiles\__construct(), MysqlMaintenance\__construct(), CreateAndPromote\__construct(), GenerateJsonI18n\__construct(), DumpRev\__construct(), ReassignEdits\__construct(), FixTimestamps\__construct(), ImportImages\__construct(), ConvertLinks\__construct(), CommandLineInstaller\__construct(), CreateCommonPasswordCdb\__construct(), RefreshLinks\__construct(), DeleteBatch\__construct(), MoveBatch\__construct(), BackupReader\__construct(), BenchmarkParse\__construct(), ConvertExtensionToRegistration\__construct(), ReplaceAll\__construct(), and CLIParser\__construct().
|
protected |
Add the default parameters to the scripts.
Definition at line 531 of file Maintenance.php.
References $mParams, addOption(), and getDbType().
Referenced by __construct().
|
protected |
Set the description text.
string | $text | The text of the description |
Definition at line 317 of file Maintenance.php.
Referenced by HHVMMakeRepo\__construct(), UpdateExtensionJsonSchema\__construct(), CheckComposerLockUpToDate\__construct(), ParserFuzzTest\__construct(), ExportSites\__construct(), ImportSites\__construct(), AddSite\__construct(), DeduplicateArchiveRevId\__construct(), FindMissingFiles\__construct(), FindOrphanedFiles\__construct(), Undelete\__construct(), PageExists\__construct(), DeleteAutoPatrolLogs\__construct(), PopulateChangeTagDef\__construct(), BenchmarkSanitizer\__construct(), EmptyUserGroup\__construct(), CompareParserCache\__construct(), InitEditCount\__construct(), PopulatePPSortKey\__construct(), BenchmarkCSSMin\__construct(), MakeTestEdits\__construct(), CheckLess\__construct(), PopulateBacklinkNamespace\__construct(), PopulateImageSha1\__construct(), Protect\__construct(), PurgeExpiredUserrights\__construct(), PurgeList\__construct(), PurgePage\__construct(), BenchmarkPurge\__construct(), RebuildMessages\__construct(), RebuildSitesCache\__construct(), BenchmarkLruHash\__construct(), SqliteMaintenance\__construct(), ViewCLI\__construct(), CheckBadRedirects\__construct(), ManageJobs\__construct(), AddRFCandPMIDInterwiki\__construct(), CheckImages\__construct(), MigrateUserGroup\__construct(), DumpBackup\__construct(), PatchSql\__construct(), UpdateLexerList\__construct(), PopulateFilearchiveSha1\__construct(), BenchmarkJSMinPlus\__construct(), DumpUploads\__construct(), BenchmarkJavaScriptMinifier\__construct(), FileOpPerfTest\__construct(), PurgeOldText\__construct(), CleanupSpam\__construct(), RebuildAll\__construct(), FixDefaultJsonContentPages\__construct(), ClearInterwikiCache\__construct(), FixUserRegistration\__construct(), ResetUserEmail\__construct(), BenchmarkStringReplacement\__construct(), ImportSiteScripts\__construct(), SyncFileBackend\__construct(), AllTrans\__construct(), ListVariants\__construct(), UpdateCSS\__construct(), RenameUserCleanup\__construct(), MigrateArchiveText\__construct(), MigrateImageCommentTemp\__construct(), DeleteEqualMessages\__construct(), DeleteOldRevisions\__construct(), DeleteSelfExternals\__construct(), CleanupBlocks\__construct(), CleanupEmptyCategories\__construct(), PopulateExternallinksIndex60\__construct(), EditCLI\__construct(), PopulateRevisionSha1\__construct(), RollbackEdits\__construct(), RebuildFileCache\__construct(), RefreshFileHeaders\__construct(), GetLagTimes\__construct(), GetReplicaServer\__construct(), GetTextMaint\__construct(), InitSiteStats\__construct(), UserOptionsMaintenance\__construct(), DatabaseLag\__construct(), JSParseHelper\__construct(), DumpMessages\__construct(), DeleteArchivedFiles\__construct(), McTest\__construct(), DeleteDefaultMessages\__construct(), MigrateFileRepoLayout\__construct(), BenchmarkHooks\__construct(), MinifyScript\__construct(), CleanupAncientTables\__construct(), NukePage\__construct(), AddChangeTag\__construct(), PopulateParentId\__construct(), EraseArchivedFile\__construct(), PopulateRecentChangesSource\__construct(), FetchText\__construct(), PruneFileCache\__construct(), PurgeModuleDeps\__construct(), BenchHttpHttps\__construct(), FixExtLinksProtocolRelative\__construct(), AlterSharedConstraints\__construct(), BenchIfSwitch\__construct(), OrphanStats\__construct(), ImportTextFiles\__construct(), BenchWfIsWindows\__construct(), UpdateDoubleWidthSearch\__construct(), CopyJobQueue\__construct(), ChangePassword\__construct(), DateFormats\__construct(), BenchWikimediaBaseConvert\__construct(), LangMemUsage\__construct(), DeleteArchivedRevisions\__construct(), MigrateActors\__construct(), MigrateComments\__construct(), MysqlMaintenance\__construct(), PopulateCategory\__construct(), AttachLatest\__construct(), PopulateLogUsertext\__construct(), ResetUserTokens\__construct(), WrapOldPasswords\__construct(), RunBatchedQuery\__construct(), UpdateArticleCount\__construct(), ManageForeignResources\__construct(), GenerateJsonI18n\__construct(), FixDoubleRedirects\__construct(), CreateAndPromote\__construct(), PopulateRevisionLength\__construct(), UpdateRestrictions\__construct(), ParserTestsMaintenance\__construct(), GenerateNormalizerDataMl\__construct(), CheckUsernames\__construct(), ReassignEdits\__construct(), FixTimestamps\__construct(), BenchmarkDeleteTruncate\__construct(), RunJobs\__construct(), FixT22757\__construct(), DeleteOrphanedRevisions\__construct(), InvalidateUserSesssions\__construct(), UpdateMediaWiki\__construct(), PopulateContentModel\__construct(), CleanupUploadStash\__construct(), PopulateInterwiki\__construct(), TitleCleanup\__construct(), MwSql\__construct(), CleanupRemovedModules\__construct(), ResetAuthenticationThrottle\__construct(), ConvertUserOptions\__construct(), PurgeParserCache\__construct(), ImportImages\__construct(), CommandLineInstaller\__construct(), CleanupUsersWithNoId\__construct(), RecountCategories\__construct(), PurgeChangedPages\__construct(), ConvertLinks\__construct(), CreateCommonPasswordCdb\__construct(), MergeMessageFileList\__construct(), PopulateIpChanges\__construct(), PopulateArchiveRevId\__construct(), ShowSiteStats\__construct(), RebuildLocalisationCache\__construct(), RefreshLinks\__construct(), UpdateSearchIndex\__construct(), DeleteBatch\__construct(), DumpIterator\__construct(), CopyFileBackend\__construct(), PopulateLogSearch\__construct(), GenerateNormalizerDataAr\__construct(), DumpLinks\__construct(), DumpCategoriesAsRdf\__construct(), RebuildRecentchanges\__construct(), Digit2Html\__construct(), UpdateCollation\__construct(), Orphans\__construct(), CompareParsers\__construct(), ShowJobs\__construct(), DumpRenderer\__construct(), NukeNS\__construct(), CleanupImages\__construct(), RebuildTextIndex\__construct(), MoveBatch\__construct(), BackupReader\__construct(), CleanupCaps\__construct(), MWDocGen\__construct(), RefreshImageMetadata\__construct(), CleanupWatchlist\__construct(), BenchmarkParse\__construct(), ImageBuilder\__construct(), GetConfiguration\__construct(), CleanupInvalidDbKeys\__construct(), NamespaceDupes\__construct(), FindHooks\__construct(), PopulateContentTables\__construct(), ConvertExtensionToRegistration\__construct(), BenchmarkTitleValue\__construct(), CompressOld\__construct(), PurgeChangedFiles\__construct(), CLIParser\__construct(), CategoryChangesAsRdf\__construct(), TextPassDumper\__construct(), FindDeprecated\__construct(), and SearchDump\__construct().
|
protected |
Add a parameter to the script.
Will be displayed on –help with the associated description
string | $name | The name of the param (help, version, etc) |
string | $description | The description of the param to show on –help |
bool | $required | Is the param required? |
bool | $withArg | Is an argument required with this option? |
string | bool | $shortName | Character to use as short name |
bool | $multiOccurrence | Can this option be passed multiple times? |
Reimplemented in PHPUnitMaintClass.
Definition at line 236 of file Maintenance.php.
References $name.
Referenced by HHVMMakeRepo\__construct(), BenchmarkTidy\__construct(), Update\__construct(), ParserFuzzTest\__construct(), Cleanup\__construct(), InitUserPreference\__construct(), AddSite\__construct(), RemoveInvalidEmails\__construct(), ParserEditTests\__construct(), FindOrphanedFiles\__construct(), FindMissingFiles\__construct(), Undelete\__construct(), DeleteAutoPatrolLogs\__construct(), BenchmarkSanitizer\__construct(), InitEditCount\__construct(), PopulateChangeTagDef\__construct(), CompareParserCache\__construct(), MakeTestEdits\__construct(), BenchmarkCSSMin\__construct(), SqliteMaintenance\__construct(), BenchmarkLruHash\__construct(), ManageJobs\__construct(), DumpBackup\__construct(), PopulateBacklinkNamespace\__construct(), PopulateImageSha1\__construct(), Protect\__construct(), PurgeList\__construct(), PurgePage\__construct(), FormatInstallDoc\__construct(), RebuildSitesCache\__construct(), RenameUserCleanup\__construct(), ResetUserEmail\__construct(), ImportSiteScripts\__construct(), SyncFileBackend\__construct(), ListVariants\__construct(), DeleteEqualMessages\__construct(), MigrateArchiveText\__construct(), DeleteOldRevisions\__construct(), DumpUploads\__construct(), CleanupSpam\__construct(), FileOpPerfTest\__construct(), PurgeOldText\__construct(), BenchmarkJavaScriptMinifier\__construct(), BenchmarkJSMinPlus\__construct(), GetTextMaint\__construct(), RollbackEdits\__construct(), InitSiteStats\__construct(), UserOptionsMaintenance\__construct(), DeleteArchivedFiles\__construct(), DatabaseLag\__construct(), CleanupAncientTables\__construct(), DeleteDefaultMessages\__construct(), McTest\__construct(), MigrateFileRepoLayout\__construct(), MinifyScript\__construct(), NukePage\__construct(), EditCLI\__construct(), RenameDbPrefix\__construct(), RebuildFileCache\__construct(), RemoveUnusedAccounts\__construct(), RefreshFileHeaders\__construct(), GetLagTimes\__construct(), GetReplicaServer\__construct(), UpdateSpecialPages\__construct(), CopyJobQueue\__construct(), UpdateDoubleWidthSearch\__construct(), AddChangeTag\__construct(), DeleteArchivedRevisions\__construct(), ChangePassword\__construct(), BenchWikimediaBaseConvert\__construct(), MysqlMaintenance\__construct(), CleanupPreferences\__construct(), EraseArchivedFile\__construct(), PruneFileCache\__construct(), ImportTextFiles\__construct(), ResetUserTokens\__construct(), RunBatchedQuery\__construct(), UpdateArticleCount\__construct(), CreateAndPromote\__construct(), ParserTestsMaintenance\__construct(), AttachLatest\__construct(), WrapOldPasswords\__construct(), FixDoubleRedirects\__construct(), GenerateJsonI18n\__construct(), RunJobs\__construct(), FixT22757\__construct(), InvalidateUserSesssions\__construct(), DeleteOrphanedRevisions\__construct(), ReassignEdits\__construct(), DeleteOldFancyCaptchas\__construct(), ResetAuthenticationThrottle\__construct(), UpdateMediaWiki\__construct(), MwSql\__construct(), GenerateFancyCaptchas\__construct(), PopulateContentModel\__construct(), PopulateInterwiki\__construct(), RecountCategories\__construct(), PopulateIpChanges\__construct(), CreateCommonPasswordCdb\__construct(), MergeMessageFileList\__construct(), ImportImages\__construct(), PurgeParserCache\__construct(), CommandLineInstaller\__construct(), PurgeChangedPages\__construct(), CleanupUsersWithNoId\__construct(), RebuildLocalisationCache\__construct(), DeleteBatch\__construct(), CommandLineInc\__construct(), RefreshLinks\__construct(), UpdateSearchIndex\__construct(), CopyFileBackend\__construct(), GenerateNormalizerDataAr\__construct(), DumpIterator\__construct(), RebuildRecentchanges\__construct(), DumpCategoriesAsRdf\__construct(), Orphans\__construct(), CompareParsers\__construct(), UpdateCollation\__construct(), ShowJobs\__construct(), Benchmarker\__construct(), DumpRenderer\__construct(), NukeNS\__construct(), TableCleanup\__construct(), MoveBatch\__construct(), BackupReader\__construct(), RefreshImageMetadata\__construct(), MWDocGen\__construct(), CleanupCaps\__construct(), PreprocessDump\__construct(), CleanupWatchlist\__construct(), BenchmarkParse\__construct(), MediaWikiShell\__construct(), GetConfiguration\__construct(), DeleteLocalPasswords\__construct(), ImageBuilder\__construct(), NamespaceDupes\__construct(), FindHooks\__construct(), CleanupInvalidDbKeys\__construct(), GenerateCollationData\__construct(), PopulateContentTables\__construct(), ConvertExtensionToRegistration\__construct(), ReplaceAll\__construct(), CompressOld\__construct(), PurgeChangedFiles\__construct(), CLIParser\__construct(), BackupDumper\__construct(), CategoryChangesAsRdf\__construct(), TextPassDumper\__construct(), SearchDump\__construct(), LoggedUpdateMaintenance\__construct(), addDefaultParams(), and setBatchSize().
|
protected |
Adjusts PHP's memory limit to better suit our needs, if needed.
Definition at line 783 of file Maintenance.php.
References memoryLimit().
Referenced by finalSetup(), and setup().
|
protected |
Execute a callback function at the end of initialisation.
Reimplemented in UpdateMediaWiki.
Definition at line 1223 of file Maintenance.php.
Referenced by finalSetup().
|
protected |
Begin a transcation on a DB.
This method makes it clear that begin() is called from a maintenance script, which has outermost scope. This is safe, unlike $dbw->begin() called in other places.
IDatabase | $dbw | |
string | $fname | Caller name |
Definition at line 1378 of file Maintenance.php.
References $fname, and Wikimedia\Rdbms\IDatabase\begin().
Referenced by CleanupSpam\cleanupArticle(), CompressOld\compressWithConcat(), CleanupPreferences\deleteByWhere(), NukePage\deleteRevisions(), DeduplicateArchiveRevId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), MigrateArchiveText\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), MigrateUserGroup\execute(), NukePage\execute(), DeleteArchivedFiles\execute(), PurgeModuleDeps\execute(), FixT22757\execute(), DeleteOrphanedRevisions\execute(), WrapOldPasswords\execute(), CleanupRemovedModules\execute(), NukeNS\execute(), MoveBatch\execute(), RebuildFileCache\execute(), UpdateCollation\execute(), RemoveUnusedAccounts\isInactiveAccount(), NamespaceDupes\mergePage(), MigrateComments\migrateToTemp(), MigrateActors\migrateToTemp(), CleanupImages\pokeFile(), PopulateContentTables\populateContentTablesForRowBatch(), purgeRedundantText(), and RenameUserCleanup\updateTable().
Maintenance::checkRequiredExtensions | ( | ) |
Verify that the required extensions are installed.
Definition at line 608 of file Maintenance.php.
References $name, as, fatalError(), and ExtensionRegistry\getInstance().
Maintenance::cleanupChanneled | ( | ) |
Clean up channeled output.
Output a newline if necessary.
Definition at line 476 of file Maintenance.php.
Referenced by output(), and outputChanneled().
Maintenance::clearParamsAndArgs | ( | ) |
Clear all params and arguments.
Definition at line 824 of file Maintenance.php.
|
protected |
Commit the transcation on a DB handle and wait for replica DBs to catch up.
This method makes it clear that commit() is called from a maintenance script, which has outermost scope. This is safe, unlike $dbw->commit() called in other places.
IDatabase | $dbw | |
string | $fname | Caller name |
Definition at line 1393 of file Maintenance.php.
References $fname, and Wikimedia\Rdbms\IDatabase\commit().
Referenced by CleanupSpam\cleanupArticle(), CompressOld\compressWithConcat(), CleanupPreferences\deleteByWhere(), NukePage\deleteRevisions(), DeduplicateArchiveRevId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), MigrateArchiveText\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), DeleteSelfExternals\execute(), MigrateUserGroup\execute(), NukePage\execute(), DeleteArchivedFiles\execute(), PurgeModuleDeps\execute(), FixT22757\execute(), DeleteOrphanedRevisions\execute(), WrapOldPasswords\execute(), CleanupRemovedModules\execute(), NukeNS\execute(), MoveBatch\execute(), RebuildFileCache\execute(), UpdateCollation\execute(), RemoveUnusedAccounts\isInactiveAccount(), NamespaceDupes\mergePage(), MigrateComments\migrateToTemp(), MigrateActors\migrateToTemp(), CleanupImages\pokeFile(), PopulateContentTables\populateContentTablesForRowBatch(), purgeRedundantText(), and RenameUserCleanup\updateTable().
|
protected |
Count down from $seconds to zero on the terminal, with a one-second pause between showing each number.
If the maintenance script is in quiet mode, this function does nothing.
@codeCoverageIgnore
int | $seconds |
Definition at line 1524 of file Maintenance.php.
References isQuiet(), and output().
Referenced by ResetUserTokens\execute(), DeleteAutoPatrolLogs\execute(), and UpdateMediaWiki\execute().
|
protected |
Remove an option.
Useful for removing options that won't be used in your script.
string | $name | The option to remove. |
Definition at line 300 of file Maintenance.php.
References $name.
|
protected |
Throw an error to the user.
Doesn't respect –quiet, so don't use this for non-error output
string | $err | The error to display |
int | $die | Deprecated since 1.31, use Maintenance::fatalError() instead |
Definition at line 442 of file Maintenance.php.
References fatalError(), outputChanneled(), and wfDeprecated().
Referenced by MigrateActors\addActorsForRows(), SqliteMaintenance\backup(), CleanupImages\buildSafeTitle(), FindOrphanedFiles\checkFiles(), SqliteMaintenance\checkSyntax(), RenameUserCleanup\checkUserExistence(), CleanupSpam\cleanupArticle(), CompressOld\compressPage(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), CopyFileBackend\delFileBatch(), PopulateRecentChangesSource\doDBUpdates(), PopulateParentId\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateLogSearch\doDBUpdates(), MigrateArchiveText\doDBUpdates(), CleanupUploadStash\doOperations(), UpdateSpecialPages\doSpecialPageCacheUpdates(), DisableOATHAuthForUser\execute(), Update\execute(), CleanupAncientTables\execute(), UpdateScratchTokenFormat\execute(), ImportSiteScripts\execute(), DeleteArchivedFiles\execute(), CountFancyCaptchas\execute(), MigrateFileRepoLayout\execute(), FixDoubleRedirects\execute(), PatchSql\execute(), ReassignEdits\execute(), Digit2Html\execute(), GenerateJsonI18n\execute(), DeleteOldFancyCaptchas\execute(), RollbackEdits\execute(), MinifyScript\execute(), DumpIterator\execute(), PurgeChangedPages\execute(), ImportTextFiles\execute(), MysqlMaintenance\execute(), GenerateNormalizerDataAr\execute(), CreateCommonPasswordCdb\execute(), DumpRenderer\execute(), SqliteMaintenance\execute(), MergeMessageFileList\execute(), MoveBatch\execute(), CreateAndPromote\execute(), PopulateInterwiki\execute(), GenerateFancyCaptchas\execute(), UpdateSearchIndex\execute(), BenchmarkParse\execute(), ConvertLinks\execute(), PurgeChangedFiles\execute(), UpdateMediaWiki\execute(), CompressOld\execute(), CategoryChangesAsRdf\execute(), ReplaceAll\execute(), fatalError(), ReplaceAll\getReplacement(), ReplaceAll\getTarget(), ReplaceAll\getUser(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), ManageForeignResources\handleTypeTar(), SqliteMaintenance\integrityCheck(), loadWithArgv(), Update\logError(), MigrateActors\migrate(), MigrateActors\migrateLogSearch(), MigrateActors\migrateToTemp(), MinifyScript\minify(), CleanupImages\pokeFile(), PopulateContentModel\populateRevisionOrArchive(), PreprocessDump\processRevision(), CompareParsers\processRevision(), PurgePage\purge(), PurgeChangedFiles\purgeFromArchiveTable(), PurgeChangedFiles\purgeFromLogType(), MergeMessageFileList\readFile(), RefreshLinks\refreshTrackingCategory(), UpdateSpecialPages\reopenAndWaitForReplicas(), ReplaceAll\replaceTitles(), runChild(), MysqlMaintenance\runMysql(), CommandLineInstaller\setDbPassOption(), setParam(), CommandLineInstaller\setPassOption(), MwSql\sqlDoQuery(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), RefreshFileHeaders\updateFileHeaders(), RenameUserCleanup\updateTable(), GetConfiguration\validateParamsAndArgs(), validateParamsAndArgs(), and CLIParser\Wikitext().
Definition at line 45 of file maintenance.txt.
|
abstract |
Do the actual work.
All child classes will need to implement this
Reimplemented in LoggedUpdateMaintenance, FakeMaintenance, ReplaceAll, BackupDumper, FindDeprecated, TextPassDumper, DumpCategoriesAsRdf, ImportImages, CategoryChangesAsRdf, GetConfiguration, MWDocGen, CommandLineInstaller, CompressOld, DeleteEqualMessages, RefreshImageMetadata, BackupReader, DeleteLocalPasswords, GenerateJqueryMsgData, UpdateMediaWiki, ParserTestsMaintenance, CleanupInvalidDbKeys, PopulateContentTables, CLIParser, PurgeChangedFiles, DumpBackup, RecountCategories, NamespaceDupes, ConvertExtensionToRegistration, PopulateCategory, UpdateCollation, ConvertLinks, BenchmarkParse, CommandLineInc, BenchmarkTitleValue, GenerateCollationData, FindHooks, ImageBuilder, UpdateSearchIndex, RebuildRecentchanges, ManageForeignResources, GenerateFancyCaptchas, PopulateInterwiki, RebuildLocalisationCache, CleanupPreferences, RebuildFileCache, MediaWikiShell, CreateAndPromote, RunJobs, CopyFileBackend, DeleteAutoPatrolLogs, RefreshLinks, MoveBatch, CleanupWatchlist, PopulateImageSha1, RebuildTextIndex, MergeMessageFileList, ShowJobs, SqliteMaintenance, CleanupCaps, FetchText, NukeNS, Orphans, PurgeParserCache, DumpRenderer, CreateCommonPasswordCdb, GenerateNormalizerDataAr, RefreshFileHeaders, ResetUserTokens, MwSql, UserOptionsMaintenance, ImportTextFiles, MysqlMaintenance, PurgeChangedPages, ResetAuthenticationThrottle, UpdateDoubleWidthSearch, TableCleanup, DeleteBatch, EditCLI, DeleteOldFancyCaptchas, DumpIterator, MinifyScript, RollbackEdits, RunBatchedQuery, GenerateJsonI18n, OrphanStats, SyncFileBackend, InvalidateUserSesssions, Digit2Html, ReassignEdits, DumpLinks, PatchSql, PopulateContentModel, PHPUnitMaintClass, RenameUserCleanup, CleanupRemovedModules, FixTimestamps, GenerateNormalizerDataMl, PopulateChangeTagDef, ShowSiteStats, WrapOldPasswords, AttachLatest, CleanupSpam, CleanupUploadStash, ConvertUserOptions, CopyJobQueue, DeleteOrphanedRevisions, FileOpPerfTest, FixDoubleRedirects, AlterSharedConstraints, RenameDbPrefix, FixT22757, UpdateSpecialPages, CountFancyCaptchas, AddChangeTag, BenchWikimediaBaseConvert, ChangePassword, DumpUploads, EraseArchivedFile, McTest, MigrateFileRepoLayout, Protect, PurgeList, ResetUserEmail, UpdateArticleCount, BenchmarkDeleteTruncate, CheckUsernames, DeleteArchivedRevisions, InitEditCount, InitSiteStats, PruneFileCache, PurgeModuleDeps, RebuildAll, UpdateRestrictions, UpdateScratchTokenFormat, DeleteArchivedFiles, DeleteDefaultMessages, GetTextMaint, ImportSiteScripts, LangMemUsage, NukePage, RemoveUnusedAccounts, DumpRev, UpdateCSS, UpdateLexerList, AddSite, BenchHttpHttps, BenchIfSwitch, BenchWfIsWindows, CleanupAncientTables, CleanupBlocks, DeleteOldRevisions, GetLagTimes, GetReplicaServer, JSParseHelper, DatabaseLag, DateFormats, ListVariants, MakeTestEdits, MigrateUserGroup, BenchmarkHooks, BenchmarkJavaScriptMinifier, BenchmarkJSMinPlus, DeleteSelfExternals, FixUserRegistration, FormatInstallDoc, DumpMessages, ManageJobs, PurgeOldText, RebuildSitesCache, BenchmarkCSSMin, BenchmarkLruHash, BenchmarkSanitizer, BenchmarkStringReplacement, CheckImages, ClearInterwikiCache, AllTrans, PurgePage, ViewCLI, BenchmarkPurge, CheckBadRedirects, CheckLess, CompareParserCache, InitUserPreference, PurgeExpiredUserrights, RebuildMessages, EmptyUserGroup, Undelete, FindMissingFiles, FindOrphanedFiles, PageExists, ParserEditTests, HHVMMakeRepo, ParserFuzzTest, ExportSites, ImportSites, StorageTypeStats, RemoveInvalidEmails, Update, CleanupArchiveUserText, Cleanup, CheckComposerLockUpToDate, DisableOATHAuthForUser, GenerateRandomImages, BenchmarkTidy, UpdateExtensionJsonSchema, ValidateRegistrationFile, and TidyUpT39714.
|
protected |
Output a message and terminate the current script.
string | $msg | Error message |
int | $exitCode | PHP exit status. Should be in range 1-254. |
Reimplemented in ManageForeignResources.
Definition at line 465 of file Maintenance.php.
References error().
Referenced by CompareParsers\checkOptions(), checkRequiredExtensions(), ResetAuthenticationThrottle\clearLoginThrottle(), UpdateMediaWiki\compatChecks(), CopyFileBackend\copyFileBatch(), CopyFileBackend\delFileBatch(), PopulateRevisionSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), error(), ValidateRegistrationFile\execute(), UpdateExtensionJsonSchema\execute(), BenchmarkTidy\execute(), CheckComposerLockUpToDate\execute(), Cleanup\execute(), ExportSites\execute(), HHVMMakeRepo\execute(), FindOrphanedFiles\execute(), Undelete\execute(), BenchmarkPurge\execute(), ViewCLI\execute(), BenchmarkJavaScriptMinifier\execute(), FormatInstallDoc\execute(), BenchmarkJSMinPlus\execute(), ManageJobs\execute(), MigrateUserGroup\execute(), MakeTestEdits\execute(), GetTextMaint\execute(), RemoveUnusedAccounts\execute(), DumpRev\execute(), DeleteDefaultMessages\execute(), LangMemUsage\execute(), PruneFileCache\execute(), UpdateRestrictions\execute(), McTest\execute(), MigrateFileRepoLayout\execute(), EraseArchivedFile\execute(), Protect\execute(), ChangePassword\execute(), AddChangeTag\execute(), ResetUserEmail\execute(), FixDoubleRedirects\execute(), CopyJobQueue\execute(), RenameDbPrefix\execute(), CleanupSpam\execute(), UpdateSpecialPages\execute(), CleanupUploadStash\execute(), FixTimestamps\execute(), WrapOldPasswords\execute(), PopulateContentModel\execute(), InvalidateUserSesssions\execute(), GenerateJsonI18n\execute(), SyncFileBackend\execute(), OrphanStats\execute(), MinifyScript\execute(), RollbackEdits\execute(), DumpIterator\execute(), EditCLI\execute(), DeleteBatch\execute(), ResetAuthenticationThrottle\execute(), UpdateDoubleWidthSearch\execute(), ImportTextFiles\execute(), CreateCommonPasswordCdb\execute(), MwSql\execute(), GenerateNormalizerDataAr\execute(), PurgeParserCache\execute(), MergeMessageFileList\execute(), RebuildTextIndex\execute(), MoveBatch\execute(), CopyFileBackend\execute(), RefreshLinks\execute(), CreateAndPromote\execute(), RunJobs\execute(), MediaWikiShell\execute(), RebuildFileCache\execute(), RebuildLocalisationCache\execute(), RebuildRecentchanges\execute(), FindHooks\execute(), GenerateCollationData\execute(), BenchmarkParse\execute(), ConvertExtensionToRegistration\execute(), RecountCategories\execute(), DumpBackup\execute(), UpdateMediaWiki\execute(), BackupReader\execute(), RefreshImageMetadata\execute(), DeleteEqualMessages\execute(), CompressOld\execute(), MWDocGen\execute(), ImportImages\execute(), GenerateCollationData\generateFirstChars(), RebuildSitesCache\getCacheFile(), MinifyScript\getExtension(), CopyFileBackend\getListingDiffRel(), BackupReader\getNsIndex(), RefreshLinks\getPossibleCategories(), PopulateContentTables\getTables(), ConvertExtensionToRegistration\handleExtensionFunctions(), ConvertExtensionToRegistration\handleHooks(), BackupReader\importFromHandle(), ReassignEdits\initialiseUser(), DeleteLocalPasswords\initialize(), loadSettings(), MinifyScript\minify(), TitleCleanup\moveInconsistentPage(), PopulateContentTables\populateContentTablesForRowBatch(), DumpBackup\processOptions(), BackupDumper\processOptions(), CommandLineInstaller\setDbPassOption(), CommandLineInstaller\setPassOption(), setup(), RefreshImageMetadata\setupParameters(), UserOptionsMaintenance\showUsageStats(), MwSql\sqlDoQuery(), SyncFileBackend\syncBackends(), GenerateJsonI18n\transformI18nFile(), and SqliteMaintenance\vacuum().
Maintenance::finalSetup | ( | ) |
Handle some last-minute setup here.
Reimplemented in DumpIterator, GetConfiguration, ParserTestsMaintenance, RebuildLocalisationCache, RebuildFileCache, PHPUnitMaintClass, ParserEditTests, and ParserFuzzTest.
Definition at line 1150 of file Maintenance.php.
References $mDbPass, $mDbUser, $wgCommandLineMode, $wgDBadminpassword, $wgDBadminuser, $wgDBDefaultGroup, $wgDBpassword, $wgDBservers, $wgDBuser, $wgLBFactoryConf, $wgServer, $wgShowExceptionDetails, $wgShowHostnames, activateProfiler(), adjustMemoryLimit(), afterFinalSetup(), as, getDbType(), getOption(), and hasOption().
|
protected |
Get an argument.
int | $argId | The integer value (from zero) for the arg |
mixed | null | $default | The default if it doesn't exist |
Definition at line 336 of file Maintenance.php.
References hasArg().
Referenced by ValidateRegistrationFile\execute(), UpdateExtensionJsonSchema\execute(), DisableOATHAuthForUser\execute(), ImportSites\execute(), ExportSites\execute(), PageExists\execute(), Undelete\execute(), EmptyUserGroup\execute(), ViewCLI\execute(), FormatInstallDoc\execute(), AddSite\execute(), MigrateUserGroup\execute(), GetTextMaint\execute(), DumpRev\execute(), ImportSiteScripts\execute(), NukePage\execute(), Protect\execute(), ResetUserEmail\execute(), McTest\execute(), CleanupSpam\execute(), FixTimestamps\execute(), ReassignEdits\execute(), GenerateJsonI18n\execute(), MinifyScript\execute(), DeleteBatch\execute(), EditCLI\execute(), ImportTextFiles\execute(), MwSql\execute(), CreateCommonPasswordCdb\execute(), MoveBatch\execute(), RefreshLinks\execute(), CreateAndPromote\execute(), ManageForeignResources\execute(), BenchmarkParse\execute(), ConvertLinks\execute(), ConvertExtensionToRegistration\execute(), BackupReader\execute(), CommandLineInstaller\execute(), ImportImages\execute(), ImportSiteScripts\fetchScriptList(), ReplaceAll\getReplacement(), ReplaceAll\getTarget(), UserOptionsMaintenance\showUsageStats(), UserOptionsMaintenance\updateOptions(), and CLIParser\Wikitext().
|
protected |
Returns batch size.
Definition at line 347 of file Maintenance.php.
References $mBatchSize.
Referenced by PopulateChangeTagDef\backpopulateChangeTagPerTag(), CleanupInvalidDbKeys\cleanupTable(), CopyJobQueue\copyJobs(), DeduplicateArchiveRevId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), FixDefaultJsonContentPages\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateChangeTagDef\doDBUpdates(), PopulateLogSearch\doDBUpdates(), MigrateArchiveText\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), PopulateRevisionLength\doLenUpdates(), PopulateRevisionSha1\doSha1Updates(), RecountCategories\doWork(), RemoveInvalidEmails\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), InitUserPreference\execute(), CheckImages\execute(), FixUserRegistration\execute(), DeleteSelfExternals\execute(), MakeTestEdits\execute(), CleanupBlocks\execute(), MigrateUserGroup\execute(), UpdateRestrictions\execute(), CheckUsernames\execute(), PurgeModuleDeps\execute(), MigrateFileRepoLayout\execute(), CleanupUploadStash\execute(), ConvertUserOptions\execute(), WrapOldPasswords\execute(), CleanupRemovedModules\execute(), InvalidateUserSesssions\execute(), PurgeChangedPages\execute(), RefreshFileHeaders\execute(), ResetUserTokens\execute(), RefreshLinks\execute(), DeleteAutoPatrolLogs\execute(), CopyFileBackend\execute(), RebuildFileCache\execute(), RefreshImageMetadata\execute(), DumpCategoriesAsRdf\getCategoryIterator(), DumpCategoriesAsRdf\getCategoryLinksIterator(), DeleteAutoPatrolLogs\getRows(), DeleteAutoPatrolLogs\getRowsOld(), DeleteLocalPasswords\getUserBatches(), PopulateContentTables\loadContentMap(), MigrateComments\migrate(), MigrateComments\migrateToTemp(), PopulateContentModel\populatePage(), PopulateContentModel\populateRevisionOrArchive(), PopulateContentTables\populateTable(), PurgeChangedFiles\purgeFromLogType(), PurgeList\purgeNamespace(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), RebuildRecentchanges\rebuildRecentChangesTablePass5(), RefreshLinks\refreshCategory(), ManageJobs\repushAbandoned(), and SyncFileBackend\syncBackends().
Maintenance::getConfig | ( | ) |
Definition at line 574 of file Maintenance.php.
References $config.
Referenced by ResetAuthenticationThrottle\clearLoginThrottle(), ResetAuthenticationThrottle\clearSignupThrottle(), FixDefaultJsonContentPages\doDBUpdates(), AddRFCandPMIDInterwiki\doDBUpdates(), Undelete\execute(), DumpIterator\execute(), DumpRenderer\execute(), RebuildSitesCache\getCacheFile(), RefreshLinks\getPossibleCategories(), BackupReader\importFromHandle(), output(), and setAgentAndTriggers().
|
protected |
Returns a database to be used by current maintenance script.
It can be set by setDB(). If not set, wfGetDB() will be used. This function has the same parameters as wfGetDB()
int | $db | DB index (DB_REPLICA/DB_MASTER) |
string | string[] | $groups | default: empty array |
string | bool | $wiki | default: current wiki |
Reimplemented in OrphanStats.
Definition at line 1351 of file Maintenance.php.
References $mDb, and wfGetDB().
Referenced by ImageBuilder\buildTable(), Orphans\checkOrphans(), Orphans\checkSeparation(), Orphans\checkWidows(), CleanupUsersWithNoId\cleanup(), CleanupSpam\cleanupArticle(), CleanupInvalidDbKeys\cleanupTable(), CompressOld\compressOldPages(), CompressOld\compressPage(), CompressOld\compressWithConcat(), ConvertLinks\createTempTable(), RefreshLinks\deleteLinksFromNonexistent(), NukePage\deleteRevisions(), RefreshLinks\dfnCheckInterval(), DeduplicateArchiveRevId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), FixDefaultJsonContentPages\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), AddRFCandPMIDInterwiki\doDBUpdates(), MigrateActors\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateExternallinksIndex60\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateLogSearch\doDBUpdates(), MigrateArchiveText\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), UpdateSearchIndex\doUpdateSearchIndex(), RecountCategories\doWork(), TidyUpT39714\execute(), RemoveInvalidEmails\execute(), StorageTypeStats\execute(), CheckBadRedirects\execute(), CompareParserCache\execute(), InitUserPreference\execute(), CheckImages\execute(), ClearInterwikiCache\execute(), DeleteSelfExternals\execute(), FixUserRegistration\execute(), MigrateUserGroup\execute(), CleanupAncientTables\execute(), GetReplicaServer\execute(), CleanupBlocks\execute(), DeleteArchivedFiles\execute(), RemoveUnusedAccounts\execute(), DeleteDefaultMessages\execute(), NukePage\execute(), UpdateScratchTokenFormat\execute(), DeleteArchivedRevisions\execute(), UpdateRestrictions\execute(), BenchmarkDeleteTruncate\execute(), CheckUsernames\execute(), PurgeModuleDeps\execute(), RebuildAll\execute(), InitEditCount\execute(), InitSiteStats\execute(), UpdateArticleCount\execute(), EraseArchivedFile\execute(), RenameDbPrefix\execute(), FixT22757\execute(), CleanupSpam\execute(), AlterSharedConstraints\execute(), DeleteOrphanedRevisions\execute(), UpdateSpecialPages\execute(), AttachLatest\execute(), FixDoubleRedirects\execute(), ConvertUserOptions\execute(), CleanupRemovedModules\execute(), ShowSiteStats\execute(), WrapOldPasswords\execute(), FixTimestamps\execute(), DumpLinks\execute(), PatchSql\execute(), PopulateContentModel\execute(), RunBatchedQuery\execute(), DeleteBatch\execute(), UpdateDoubleWidthSearch\execute(), PurgeChangedPages\execute(), RefreshFileHeaders\execute(), ResetUserTokens\execute(), NukeNS\execute(), FetchText\execute(), SqliteMaintenance\execute(), RebuildTextIndex\execute(), MoveBatch\execute(), CleanupPreferences\execute(), RebuildFileCache\execute(), ImageBuilder\execute(), ConvertLinks\execute(), PopulateCategory\execute(), UpdateCollation\execute(), NamespaceDupes\execute(), PurgeChangedFiles\execute(), UpdateMediaWiki\execute(), RefreshImageMetadata\execute(), DeleteEqualMessages\execute(), CategoryChangesAsRdf\execute(), DumpCategoriesAsRdf\execute(), LoggedUpdateMaintenance\execute(), DumpUploads\fetchLocal(), DumpUploads\fetchUsed(), TitleCleanup\fileExists(), RefreshLinks\fixRedirect(), BenchmarkParse\getRevIdForTime(), FixT22757\getRevTextMap(), RollbackEdits\getRollbackTitles(), DeleteLocalPasswords\getUserBatches(), DeleteLocalPasswords\getUserDB(), FixDefaultJsonContentPages\handleRow(), BackupReader\handleUpload(), PopulateContentTables\initServices(), RemoveUnusedAccounts\isInactiveAccount(), CleanupImages\killRow(), PopulateContentTables\loadContentMap(), MigrateComments\migrate(), MigrateActors\migrate(), MigrateActors\migrateLogSearch(), MigrateComments\migrateToTemp(), MigrateActors\migrateToTemp(), TitleCleanup\moveIllegalPage(), TitleCleanup\moveInconsistentPage(), CleanupImages\pokeFile(), PurgeChangedFiles\purgeFromLogType(), PurgeList\purgeNamespace(), purgeRedundantText(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), RefreshLinks\refreshCategory(), CleanupWatchlist\removeWatch(), TableCleanup\runTable(), EraseArchivedFile\scrubAllVersions(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionLength\upgradeRow(), and PopulateRevisionSha1\upgradeRow().
Maintenance::getDbType | ( | ) |
Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB.
Sometimes, a script needs admin rights access for a reason and sometimes they want no access. Subclasses should override and return one of the following values, as needed: Maintenance::DB_NONE - For no DB access at all Maintenance::DB_STD - For normal DB access, default Maintenance::DB_ADMIN - For admin DB access
Reimplemented in MwSql, SearchDump, RunBatchedQuery, CommandLineInstaller, PHPUnitMaintClass, MWDocGen, ConvertLinks, CleanupArchiveUserText, UpdateMediaWiki, FindHooks, UpdateSearchIndex, PreprocessDump, RebuildTextIndex, SqliteMaintenance, GenerateNormalizerDataAr, UpdateDoubleWidthSearch, PatchSql, GenerateNormalizerDataMl, AlterSharedConstraints, RenameDbPrefix, RebuildAll, and GenerateRandomImages.
Definition at line 524 of file Maintenance.php.
References DB_STD.
Referenced by addDefaultParams(), DumpIterator\finalSetup(), and finalSetup().
|
protected |
Maintenance::getName | ( | ) |
Get the script's name.
Definition at line 377 of file Maintenance.php.
References $mSelf.
|
protected |
Get an option, or return the default.
If the option was added to support multiple occurrences, this will return an array.
string | $name | The name of the param |
mixed | null | $default | Anything you want, default null |
Definition at line 271 of file Maintenance.php.
References $name, and hasOption().
Referenced by activateProfiler(), PopulateChangeTagDef\backpopulateChangeTagPerTag(), Benchmarker\bench(), PreprocessDump\checkOptions(), CompareParsers\checkOptions(), SqliteMaintenance\checkSyntax(), RenameUserCleanup\checkUserExistence(), PopulateBacklinkNamespace\doDBUpdates(), CleanupUsersWithNoId\doDBUpdates(), PopulateChangeTagDef\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), FileOpPerfTest\doPerfTest(), PurgeList\doPurge(), UpdateSpecialPages\doSpecialPageCacheUpdates(), BenchmarkTidy\execute(), Update\execute(), HHVMMakeRepo\execute(), ParserFuzzTest\execute(), ParserEditTests\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), Undelete\execute(), CompareParserCache\execute(), InitUserPreference\execute(), BenchmarkPurge\execute(), BenchmarkCSSMin\execute(), BenchmarkLruHash\execute(), BenchmarkSanitizer\execute(), BenchmarkJSMinPlus\execute(), ManageJobs\execute(), BenchmarkJavaScriptMinifier\execute(), FormatInstallDoc\execute(), AddSite\execute(), MakeTestEdits\execute(), GetReplicaServer\execute(), RemoveUnusedAccounts\execute(), ImportSiteScripts\execute(), PruneFileCache\execute(), BenchWikimediaBaseConvert\execute(), McTest\execute(), MigrateFileRepoLayout\execute(), DumpUploads\execute(), EraseArchivedFile\execute(), Protect\execute(), ChangePassword\execute(), PurgeList\execute(), AddChangeTag\execute(), RenameDbPrefix\execute(), FixT22757\execute(), CopyJobQueue\execute(), UpdateSpecialPages\execute(), FileOpPerfTest\execute(), FixDoubleRedirects\execute(), RenameUserCleanup\execute(), WrapOldPasswords\execute(), PHPUnitMaintClass\execute(), PopulateContentModel\execute(), InvalidateUserSesssions\execute(), SyncFileBackend\execute(), GenerateJsonI18n\execute(), RunBatchedQuery\execute(), RollbackEdits\execute(), MinifyScript\execute(), DumpIterator\execute(), DeleteOldFancyCaptchas\execute(), DeleteBatch\execute(), EditCLI\execute(), ResetAuthenticationThrottle\execute(), ImportTextFiles\execute(), MysqlMaintenance\execute(), UpdateDoubleWidthSearch\execute(), PurgeChangedPages\execute(), MwSql\execute(), CreateCommonPasswordCdb\execute(), GenerateNormalizerDataAr\execute(), ResetUserTokens\execute(), RefreshFileHeaders\execute(), DumpRenderer\execute(), NukeNS\execute(), CleanupCaps\execute(), PurgeParserCache\execute(), SqliteMaintenance\execute(), ShowJobs\execute(), MergeMessageFileList\execute(), PopulateImageSha1\execute(), MoveBatch\execute(), RefreshLinks\execute(), CopyFileBackend\execute(), DeleteAutoPatrolLogs\execute(), RunJobs\execute(), CreateAndPromote\execute(), RebuildFileCache\execute(), GenerateFancyCaptchas\execute(), PopulateInterwiki\execute(), RebuildLocalisationCache\execute(), UpdateSearchIndex\execute(), GenerateCollationData\execute(), BenchmarkParse\execute(), PopulateCategory\execute(), UpdateCollation\execute(), ConvertExtensionToRegistration\execute(), NamespaceDupes\execute(), RecountCategories\execute(), PurgeChangedFiles\execute(), PopulateContentTables\execute(), CleanupInvalidDbKeys\execute(), ParserTestsMaintenance\execute(), UpdateMediaWiki\execute(), BackupReader\execute(), RefreshImageMetadata\execute(), DeleteEqualMessages\execute(), CompressOld\execute(), CommandLineInstaller\execute(), GetConfiguration\execute(), CategoryChangesAsRdf\execute(), ImportImages\execute(), DumpCategoriesAsRdf\execute(), ReplaceAll\execute(), GetConfiguration\finalSetup(), finalSetup(), RebuildSitesCache\getCacheFile(), RefreshImageMetadata\getConditions(), ReplaceAll\getNamespaces(), ReplaceAll\getReplacements(), DeleteAutoPatrolLogs\getRows(), DeleteAutoPatrolLogs\getRowsOld(), ReplaceAll\getSummary(), PopulateContentTables\getTables(), CLIParser\getTitle(), ReplaceAll\getUser(), BackupReader\importFromHandle(), MWDocGen\init(), DeleteLocalPasswords\initialize(), loadSpecialVars(), ReplaceAll\localSetup(), memoryLimit(), CLIParser\parse(), PopulateContentTables\populateTable(), DumpBackup\processOptions(), TextPassDumper\processOptions(), BackupDumper\processOptions(), CompareParsers\processRevision(), SearchDump\processRevision(), DeleteLocalPasswords\processUsers(), PurgePage\purge(), PurgeChangedFiles\purgeFromLogType(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), PurgeList\sendPurgeRequest(), CommandLineInstaller\setDbPassOption(), CommandLineInstaller\setPassOption(), MediaWikiShell\setupLegacy(), ReplaceAll\shouldContinueByDefault(), SyncFileBackend\syncFileBatch(), UserOptionsMaintenance\updateOptions(), ReplaceAll\useRegex(), and GetConfiguration\validateParamsAndArgs().
|
protected |
Return input from stdin.
int | null | $len | The number of bytes to read. If null, just return the handle. Maintenance::STDIN_ALL returns the full length |
Reimplemented in MediaWiki\Tests\Maintenance\SemiMockedFetchText.
Definition at line 387 of file Maintenance.php.
References $input.
Referenced by PurgeList\doPurge(), PurgePage\execute(), DumpIterator\execute(), DeleteBatch\execute(), EditCLI\execute(), FetchText\execute(), DumpRenderer\execute(), and MoveBatch\execute().
|
static |
Get the terminal size as a two-element array where the first element is the width (number of columns) and the second element is the height (number of rows).
Definition at line 1630 of file Maintenance.php.
References wfIsWindows().
Referenced by ParserEditTests\execute().
Maintenance::globals | ( | ) |
Potentially debug globals.
Originally a feature only for refreshLinks
Definition at line 1233 of file Maintenance.php.
References $GLOBALS, and hasOption().
|
protected |
Does a given argument exist?
int | $argId | The integer value (from zero) for the arg |
Definition at line 326 of file Maintenance.php.
Referenced by FormatInstallDoc\execute(), JSParseHelper\execute(), McTest\execute(), ReassignEdits\execute(), DeleteBatch\execute(), UserOptionsMaintenance\execute(), MwSql\execute(), MoveBatch\execute(), BackupReader\execute(), getArg(), and validateParamsAndArgs().
|
protected |
Checks to see if a particular option exists.
string | $name | The name of the option |
Definition at line 257 of file Maintenance.php.
References $name.
Referenced by PopulateChangeTagDef\backpopulateChangeTagPerTag(), Benchmarker\bench(), PreprocessDump\checkOptions(), CompareParsers\checkOptions(), CleanupSpam\cleanupArticle(), CleanupInvalidDbKeys\cleanupTable(), CopyFileBackend\copyFileBatch(), ConvertLinks\createTempTable(), CleanupPreferences\deleteByWhere(), PopulateChangeTagDef\doDBUpdates(), MigrateArchiveText\doDBUpdates(), PopulateImageSha1\doDBUpdates(), FileOpPerfTest\doPerfTest(), UpdateSpecialPages\doSpecialPageCacheUpdates(), BenchmarkTidy\execute(), Cleanup\execute(), RemoveInvalidEmails\execute(), ParserEditTests\execute(), FindOrphanedFiles\execute(), BenchmarkPurge\execute(), BenchmarkCSSMin\execute(), FormatInstallDoc\execute(), PurgeOldText\execute(), ListVariants\execute(), DatabaseLag\execute(), DeleteOldRevisions\execute(), CleanupAncientTables\execute(), GetLagTimes\execute(), GetReplicaServer\execute(), DeleteDefaultMessages\execute(), DeleteArchivedFiles\execute(), NukePage\execute(), GetTextMaint\execute(), RemoveUnusedAccounts\execute(), DeleteArchivedRevisions\execute(), InitSiteStats\execute(), InitEditCount\execute(), UpdateArticleCount\execute(), DumpUploads\execute(), EraseArchivedFile\execute(), ChangePassword\execute(), Protect\execute(), PurgeList\execute(), ResetUserEmail\execute(), AttachLatest\execute(), UpdateSpecialPages\execute(), DeleteOrphanedRevisions\execute(), CleanupSpam\execute(), FixDoubleRedirects\execute(), WrapOldPasswords\execute(), ReassignEdits\execute(), SyncFileBackend\execute(), GenerateJsonI18n\execute(), MinifyScript\execute(), DumpIterator\execute(), RollbackEdits\execute(), TableCleanup\execute(), EditCLI\execute(), MysqlMaintenance\execute(), PurgeChangedPages\execute(), ImportTextFiles\execute(), GenerateNormalizerDataAr\execute(), UserOptionsMaintenance\execute(), RefreshFileHeaders\execute(), MwSql\execute(), NukeNS\execute(), Orphans\execute(), CleanupCaps\execute(), DumpRenderer\execute(), SqliteMaintenance\execute(), MergeMessageFileList\execute(), ShowJobs\execute(), CleanupWatchlist\execute(), PopulateImageSha1\execute(), MoveBatch\execute(), DeleteAutoPatrolLogs\execute(), RefreshLinks\execute(), CopyFileBackend\execute(), CreateAndPromote\execute(), RunJobs\execute(), CleanupPreferences\execute(), RebuildFileCache\execute(), MediaWikiShell\execute(), GenerateFancyCaptchas\execute(), PopulateInterwiki\execute(), RebuildLocalisationCache\execute(), RebuildRecentchanges\execute(), ImageBuilder\execute(), UpdateSearchIndex\execute(), BenchmarkParse\execute(), ConvertLinks\execute(), UpdateCollation\execute(), PopulateCategory\execute(), ConvertExtensionToRegistration\execute(), NamespaceDupes\execute(), DumpBackup\execute(), PurgeChangedFiles\execute(), CleanupInvalidDbKeys\execute(), ParserTestsMaintenance\execute(), UpdateMediaWiki\execute(), BackupReader\execute(), RefreshImageMetadata\execute(), DeleteEqualMessages\execute(), CommandLineInstaller\execute(), ImportImages\execute(), LoggedUpdateMaintenance\execute(), CopyFileBackend\filesAreSame(), GetConfiguration\finalSetup(), finalSetup(), UpdateCollation\getBatchCondition(), RebuildSitesCache\getCacheFile(), CommandLineInstaller\getDbType(), FindHooks\getHooksFromDoc(), getOption(), ReplaceAll\getRename(), globals(), ConvertExtensionToRegistration\handleResourceModules(), BackupReader\importFromHandle(), MWDocGen\init(), DeleteLocalPasswords\initialize(), loadSpecialVars(), maybeHelp(), RunJobs\memoryLimit(), PopulateContentTables\populateTable(), DumpBackup\processOptions(), TextPassDumper\processOptions(), BackupDumper\processOptions(), PurgeChangedFiles\purgeFromLogType(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), CleanupWatchlist\removeWatch(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), PopulateChangeTagDef\setUserDefinedTags(), MwSql\sqlPrintResult(), PopulateChangeTagDef\updateCountTag(), PopulateChangeTagDef\updateCountTagId(), UserOptionsMaintenance\updateOptions(), CommandLineInstaller\validateParamsAndArgs(), validateParamsAndArgs(), ManageForeignResources\verbose(), PurgeChangedFiles\verbose(), and UserOptionsMaintenance\warn().
Maintenance::isQuiet | ( | ) |
Definition at line 404 of file Maintenance.php.
References $mQuiet.
Referenced by countDown(), and SyncFileBackend\execute().
Maintenance::loadParamsAndArgs | ( | $self = null , |
|
$opts = null , |
|||
$args = null |
|||
) |
Process command line arguments $mOptions becomes an array with keys set to the option names $mArgs becomes a zero-based array containing the non-option arguments.
string | null | $self | The name of the script, if any |
array | null | $opts | An array of options, in form of key=>value |
array | null | $args | An array of command line arguments |
Definition at line 950 of file Maintenance.php.
References $args, $self, loadSpecialVars(), and loadWithArgv().
Referenced by ClearUserWatchlistJobTest\runJobs(), CategoryMembershipChangeJobTest\runJobs(), setup(), ApiDeleteTest\testBatchedDelete(), WikiPageDbTestBase\testDoDeleteArticle(), WikiPageDbTestBase\testDoDeleteUpdates(), and TemplateCategoriesTest\testTemplateCategories().
Maintenance::loadSettings | ( | ) |
Generic setup for most installs.
Returns the location of LocalSettings
Definition at line 1243 of file Maintenance.php.
References $IP, $wgCommandLineMode, captcha-old\count, and fatalError().
|
protected |
Handle the special variables that are global to all scripts.
Definition at line 1016 of file Maintenance.php.
References getOption(), and hasOption().
Referenced by loadParamsAndArgs(), and loadWithArgv().
Maintenance::loadWithArgv | ( | $argv | ) |
Load params and arguments from a given array of command-line arguments.
array | $argv |
Definition at line 837 of file Maintenance.php.
References $args, $options, captcha-old\count, error(), loadSpecialVars(), maybeHelp(), and setParam().
Referenced by DumpBackup\__construct(), BackupDumper\__construct(), TextPassDumper\__construct(), and loadParamsAndArgs().
|
private |
Lock the search index.
IMaintainableDatabase | &$db |
Definition at line 1421 of file Maintenance.php.
Referenced by relockSearchindex(), and updateSearchIndex().
|
protected |
Maybe show the help.
bool | $force | Whether to force the help to show, default false |
Reimplemented in CommandLineInc.
Definition at line 1035 of file Maintenance.php.
References $mDependantParameters, $output, as, captcha-old\count, hasOption(), output(), and script().
Referenced by JSParseHelper\execute(), GenerateJsonI18n\execute(), PurgeChangedPages\execute(), UserOptionsMaintenance\execute(), CreateAndPromote\execute(), PurgeChangedFiles\execute(), BackupReader\importFromStdin(), loadWithArgv(), setParam(), setup(), GetConfiguration\validateParamsAndArgs(), and validateParamsAndArgs().
Maintenance::memoryLimit | ( | ) |
Normally we disable the memory_limit when running admin scripts.
Some scripts may wish to actually set a limit, however, to avoid blowing up unexpectedly. We also support a –memory-limit option, to allow sysadmins to explicitly set one if they'd prefer to override defaults (or for people using Suhosin which yells at you for trying to disable the limits)
Reimplemented in RunJobs.
Definition at line 774 of file Maintenance.php.
References getOption().
Referenced by adjustMemoryLimit(), and ParserFuzzTest\fuzzTest().
|
protected |
Throw some output to the user.
Scripts can call this with no fears, as we handle all –quiet stuff here
string | $out | The text to show to the user |
mixed | null | $channel | Unique identifier for the channel. See function outputChanneled. |
Definition at line 414 of file Maintenance.php.
References $out, class, cleanupChanneled(), MediaWiki\emitBufferedStatsdData(), getConfig(), and outputChanneled().
Referenced by DumpBackup\__construct(), TextPassDumper\__construct(), ImageBuilder\addMissingImage(), Benchmarker\addResult(), PopulateChangeTagDef\backpopulateChangeTagPerTag(), SqliteMaintenance\backup(), ImageBuilder\buildTable(), NamespaceDupes\checkAll(), FindOrphanedFiles\checkFiles(), NamespaceDupes\checkLinkTable(), NamespaceDupes\checkNamespace(), Orphans\checkOrphans(), NamespaceDupes\checkPrefix(), RenameUserCleanup\checkRenameLog(), Orphans\checkSeparation(), SqliteMaintenance\checkSyntax(), RenameUserCleanup\checkUserExistence(), Orphans\checkWidows(), CleanupUsersWithNoId\cleanup(), Cleanup\cleanupArticle(), CleanupSpam\cleanupArticle(), ResetAuthenticationThrottle\clearLoginThrottle(), RebuildTextIndex\clearSearchIndex(), ResetAuthenticationThrottle\clearSignupThrottle(), CompressOld\compressOldPages(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), countDown(), RebuildTextIndex\createMysqlTextIndex(), ConvertLinks\createTempTable(), RunJobs\debugInternal(), ManageJobs\delete(), CleanupPreferences\deleteByWhere(), RefreshLinks\deleteLinksFromNonexistent(), CopyFileBackend\delFileBatch(), RefreshLinks\dfnCheckInterval(), DeduplicateArchiveRevId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), FixDefaultJsonContentPages\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), MigrateActors\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateParentId\doDBUpdates(), MigrateComments\doDBUpdates(), PopulateExternallinksIndex60\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateLogSearch\doDBUpdates(), MigrateArchiveText\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), FileOpPerfTest\doPerfTest(), PopulateInterwiki\doPopulate(), PurgeList\doPurge(), ReassignEdits\doReassignEdits(), RebuildLocalisationCache\doRebuild(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), UpdateSpecialPages\doSpecialPageCacheUpdates(), UpdateSearchIndex\doUpdateSearchIndex(), RecountCategories\doWork(), RebuildTextIndex\dropMysqlTextIndex(), TidyUpT39714\execute(), ValidateRegistrationFile\execute(), UpdateExtensionJsonSchema\execute(), DisableOATHAuthForUser\execute(), CheckComposerLockUpToDate\execute(), CleanupArchiveUserText\execute(), Cleanup\execute(), Update\execute(), RemoveInvalidEmails\execute(), ExportSites\execute(), ImportSites\execute(), PageExists\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), Undelete\execute(), EmptyUserGroup\execute(), BenchmarkPurge\execute(), PurgeExpiredUserrights\execute(), CheckBadRedirects\execute(), CompareParserCache\execute(), RebuildMessages\execute(), InitUserPreference\execute(), AllTrans\execute(), ViewCLI\execute(), ClearInterwikiCache\execute(), CheckImages\execute(), DumpMessages\execute(), DeleteSelfExternals\execute(), FixUserRegistration\execute(), GetReplicaServer\execute(), JSParseHelper\execute(), DatabaseLag\execute(), DateFormats\execute(), UpdateCSS\execute(), UpdateLexerList\execute(), MigrateUserGroup\execute(), MakeTestEdits\execute(), DeleteOldRevisions\execute(), GetLagTimes\execute(), CleanupAncientTables\execute(), CleanupBlocks\execute(), LangMemUsage\execute(), DumpRev\execute(), UpdateScratchTokenFormat\execute(), DeleteArchivedFiles\execute(), DeleteDefaultMessages\execute(), NukePage\execute(), GetTextMaint\execute(), ImportSiteScripts\execute(), RemoveUnusedAccounts\execute(), UpdateRestrictions\execute(), DeleteArchivedRevisions\execute(), InitSiteStats\execute(), PruneFileCache\execute(), PurgeModuleDeps\execute(), RebuildAll\execute(), CheckUsernames\execute(), InitEditCount\execute(), CountFancyCaptchas\execute(), AddChangeTag\execute(), MigrateFileRepoLayout\execute(), UpdateArticleCount\execute(), McTest\execute(), EraseArchivedFile\execute(), ChangePassword\execute(), Protect\execute(), PurgeList\execute(), ConvertUserOptions\execute(), CopyJobQueue\execute(), UpdateSpecialPages\execute(), AttachLatest\execute(), RenameDbPrefix\execute(), DeleteOrphanedRevisions\execute(), AlterSharedConstraints\execute(), CleanupSpam\execute(), CleanupUploadStash\execute(), FixDoubleRedirects\execute(), ShowSiteStats\execute(), CleanupRemovedModules\execute(), RenameUserCleanup\execute(), PopulateChangeTagDef\execute(), WrapOldPasswords\execute(), FixTimestamps\execute(), PatchSql\execute(), DumpLinks\execute(), InvalidateUserSesssions\execute(), Digit2Html\execute(), ReassignEdits\execute(), OrphanStats\execute(), SyncFileBackend\execute(), GenerateJsonI18n\execute(), DeleteOldFancyCaptchas\execute(), RunBatchedQuery\execute(), RollbackEdits\execute(), DeleteBatch\execute(), TableCleanup\execute(), EditCLI\execute(), UpdateDoubleWidthSearch\execute(), PurgeChangedPages\execute(), ImportTextFiles\execute(), ResetUserTokens\execute(), CreateCommonPasswordCdb\execute(), RefreshFileHeaders\execute(), PurgeParserCache\execute(), CleanupCaps\execute(), NukeNS\execute(), FetchText\execute(), ShowJobs\execute(), CleanupWatchlist\execute(), RebuildTextIndex\execute(), MoveBatch\execute(), CopyFileBackend\execute(), DeleteAutoPatrolLogs\execute(), RunJobs\execute(), CreateAndPromote\execute(), CleanupPreferences\execute(), RebuildFileCache\execute(), RebuildLocalisationCache\execute(), GenerateFancyCaptchas\execute(), ManageForeignResources\execute(), RebuildRecentchanges\execute(), FindHooks\execute(), ConvertLinks\execute(), PopulateCategory\execute(), UpdateCollation\execute(), ConvertExtensionToRegistration\execute(), NamespaceDupes\execute(), RecountCategories\execute(), UpdateMediaWiki\execute(), DeleteLocalPasswords\execute(), BackupReader\execute(), RefreshImageMetadata\execute(), DeleteEqualMessages\execute(), CompressOld\execute(), MWDocGen\execute(), GetConfiguration\execute(), ImportImages\execute(), LoggedUpdateMaintenance\execute(), ManageForeignResources\fetch(), DeleteEqualMessages\fetchMessageInfo(), ImportSiteScripts\fetchScriptList(), GetConfiguration\formatVarDump(), DeleteLocalPasswords\getUserBatches(), ConvertExtensionToRegistration\handleExtensionMessagesFiles(), ConvertExtensionToRegistration\handleHooks(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), FixDefaultJsonContentPages\handleRow(), MWDocGen\init(), SqliteMaintenance\integrityCheck(), CleanupImages\killRow(), UserOptionsMaintenance\listAvailableOptions(), ReplaceAll\listTitles(), Update\logInfo(), maybeHelp(), MigrateComments\migrate(), MigrateActors\migrate(), MigrateActors\migrateLogSearch(), MigrateComments\migrateToTemp(), MigrateActors\migrateToTemp(), MinifyScript\minify(), TitleCleanup\moveIllegalPage(), TitleCleanup\moveInconsistentPage(), CleanupCaps\movePage(), ImageBuilder\oldimageCallback(), DumpUploads\outputItem(), CleanupImages\pokeFile(), PopulateContentModel\populatePage(), PopulateContentModel\populateRevisionOrArchive(), RebuildTextIndex\populateSearchIndex(), FindHooks\printArray(), DeduplicateArchiveRevId\processArRevIds(), CompareParsers\processRevision(), SearchDump\processRevision(), TitleCleanup\processRow(), CleanupImages\processRow(), CleanupWatchlist\processRow(), CleanupCaps\processRowToLowercase(), CleanupCaps\processRowToUppercase(), TableCleanup\progress(), ImageBuilder\progress(), PruneFileCache\prune_directory(), PurgePage\purge(), RebuildRecentchanges\purgeFeeds(), PurgeChangedFiles\purgeFromArchiveTable(), purgeRedundantText(), FixDoubleRedirects\queueJobs(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), RebuildRecentchanges\rebuildRecentChangesTablePass5(), RefreshLinks\refreshCategory(), CleanupWatchlist\removeWatch(), UpdateSpecialPages\reopenAndWaitForReplicas(), ImportSites\reportException(), ManageJobs\repushAbandoned(), MigrateFileRepoLayout\runBatch(), TableCleanup\runTable(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), PopulateChangeTagDef\setUserDefinedTags(), PurgeParserCache\showProgressAndWait(), UpdateCollation\showSortKeySizeHistogram(), UserOptionsMaintenance\showUsageStats(), MwSql\sqlPrintResult(), Benchmarker\startBench(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), GenerateJsonI18n\transformI18nFile(), PopulateChangeTagDef\updateCountTag(), PopulateChangeTagDef\updateCountTagId(), UserOptionsMaintenance\updateOptions(), PopulateContentModel\updatePageRows(), PopulateContentModel\updateRevisionOrArchiveRows(), updateSearchIndex(), updateSearchIndexForPage(), RenameUserCleanup\updateTable(), ResetUserTokens\updateUser(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionLength\upgradeRow(), PopulateRevisionSha1\upgradeRow(), SqliteMaintenance\vacuum(), ManageForeignResources\verbose(), PurgeChangedFiles\verbose(), Benchmarker\verboseRun(), UserOptionsMaintenance\warn(), and PopulateContentTables\writeln().
Maintenance::outputChanneled | ( | $msg, | |
$channel = null |
|||
) |
Message outputter with channeled message support.
Messages on the same channel are concatenated, but any intervening messages in another channel start a new line.
string | $msg | The message without trailing newline |
string | null | $channel | Channel identifier or null for no channel. Channel comparison uses ===. |
Definition at line 491 of file Maintenance.php.
References cleanupChanneled().
|
static |
Wrapper for posix_isatty() We default as considering stdin a tty (for nice readline methods) but treating stout as not a tty to avoid color codes.
mixed | $fd | File descriptor |
Definition at line 1548 of file Maintenance.php.
Referenced by MwSql\execute(), ParserTestsMaintenance\execute(), FindDeprecated\execute(), and readconsole().
Maintenance::purgeRedundantText | ( | $delete = true | ) |
Support function for cleaning up redundant text records.
bool | $delete | Whether or not to actually delete the records |
Definition at line 1283 of file Maintenance.php.
References $res, as, beginTransaction(), commitTransaction(), captcha-old\count, DB_MASTER, getDB(), and output().
Referenced by DeleteOldRevisions\doDelete(), PurgeOldText\execute(), NukePage\execute(), DeleteArchivedRevisions\execute(), DeleteOrphanedRevisions\execute(), and NukeNS\execute().
|
static |
Prompt the console for input.
string | $prompt | What to begin the line with, like '> ' |
Definition at line 1561 of file Maintenance.php.
References posix_isatty(), and readlineEmulation().
Referenced by MwSql\execute(), ReplaceAll\getReply(), and ParserEditTests\handleFailure().
|
staticprivate |
Emulate readline()
string | $prompt | What to begin the line with, like '> ' |
Definition at line 1593 of file Maintenance.php.
References $command, $line, $retval, ExecutableFinder\findInDefaultPaths(), wfEscapeShellArg(), wfIsWindows(), and wfShellExec().
Referenced by readconsole().
|
private |
Unlock and lock again Since the lock is low-priority, queued reads will be able to complete.
IMaintainableDatabase | &$db |
Definition at line 1448 of file Maintenance.php.
References lockSearchindex(), and unlockSearchindex().
Referenced by updateSearchIndex().
|
protected |
Indicate that the specified extension must be loaded before the script can run.
This must be called in the constructor.
string | $name |
Definition at line 599 of file Maintenance.php.
References $name.
Referenced by Update\__construct(), DisableOATHAuthForUser\__construct(), CleanupArchiveUserText\__construct(), Cleanup\__construct(), RenameUserCleanup\__construct(), UpdateCSS\__construct(), UpdateLexerList\__construct(), UpdateScratchTokenFormat\__construct(), DeleteOldFancyCaptchas\__construct(), CountFancyCaptchas\__construct(), GenerateFancyCaptchas\__construct(), and ReplaceAll\__construct().
|
static |
Call this to set up the autoloader to allow classes to be used from the tests directory.
Definition at line 1660 of file Maintenance.php.
Referenced by CheckLess\execute(), ParserFuzzTest\finalSetup(), ParserEditTests\finalSetup(), PHPUnitMaintClass\finalSetup(), and ParserTestsMaintenance\finalSetup().
|
protected |
Rollback the transcation on a DB handle.
This method makes it clear that rollback() is called from a maintenance script, which has outermost scope. This is safe, unlike $dbw->rollback() called in other places.
IDatabase | $dbw | |
string | $fname | Caller name |
Definition at line 1413 of file Maintenance.php.
References $fname, and Wikimedia\Rdbms\IDatabase\rollback().
Referenced by CleanupImages\pokeFile(), PopulateContentTables\populateContentTablesForRowBatch(), and RenameUserCleanup\updateTable().
Maintenance::runChild | ( | $maintClass, | |
$classFile = null |
|||
) |
Run a child maintenance script.
Pass all of the current arguments to it.
string | $maintClass | A name of a child maintenance class |
string | null | $classFile | Full path of where the child is |
Definition at line 688 of file Maintenance.php.
References $maintClass, and error().
Referenced by RebuildAll\execute(), NukeNS\execute(), and UpdateMediaWiki\execute().
Maintenance::setAgentAndTriggers | ( | ) |
Set triggers like when to try to run deferred updates.
Definition at line 629 of file Maintenance.php.
References getConfig(), setLBFactoryTriggers(), and wfHostname().
|
protected |
Sets whether to allow unregistered options, which are options passed to a script that do not match an expected parameter.
bool | $allow | Should we allow? |
Definition at line 309 of file Maintenance.php.
Referenced by PHPUnitMaintClass\__construct(), and CommandLineInc\__construct().
|
protected |
Set the batch size.
int | $s | The number of operations to do in a batch |
Definition at line 355 of file Maintenance.php.
References $s, and addOption().
Referenced by InitUserPreference\__construct(), RemoveInvalidEmails\__construct(), DeduplicateArchiveRevId\__construct(), FindMissingFiles\__construct(), FindOrphanedFiles\__construct(), DeleteAutoPatrolLogs\__construct(), PopulateChangeTagDef\__construct(), PopulatePPSortKey\__construct(), MakeTestEdits\__construct(), MigrateUserGroup\__construct(), PurgeList\__construct(), CheckImages\__construct(), DeleteSelfExternals\__construct(), FixDefaultJsonContentPages\__construct(), FixUserRegistration\__construct(), RenameUserCleanup\__construct(), SyncFileBackend\__construct(), CleanupBlocks\__construct(), PopulateExternallinksIndex60\__construct(), PopulateRevisionSha1\__construct(), RebuildFileCache\__construct(), RefreshFileHeaders\__construct(), MigrateFileRepoLayout\__construct(), PopulateRecentChangesSource\__construct(), PurgeModuleDeps\__construct(), CopyJobQueue\__construct(), MigrateActors\__construct(), MigrateComments\__construct(), CleanupPreferences\__construct(), PopulateRevisionLength\__construct(), PopulateLogUsertext\__construct(), CheckUsernames\__construct(), UpdateRestrictions\__construct(), ResetUserTokens\__construct(), WrapOldPasswords\__construct(), InvalidateUserSesssions\__construct(), CleanupRemovedModules\__construct(), CleanupUploadStash\__construct(), PopulateContentModel\__construct(), ConvertUserOptions\__construct(), PurgeChangedPages\__construct(), CleanupUsersWithNoId\__construct(), RecountCategories\__construct(), PopulateArchiveRevId\__construct(), RefreshLinks\__construct(), PopulateLogSearch\__construct(), CopyFileBackend\__construct(), DumpCategoriesAsRdf\__construct(), RebuildRecentchanges\__construct(), RefreshImageMetadata\__construct(), DeleteLocalPasswords\__construct(), CleanupInvalidDbKeys\__construct(), PopulateContentTables\__construct(), PurgeChangedFiles\__construct(), CategoryChangesAsRdf\__construct(), LoggedUpdateMaintenance\__construct(), PopulateChangeTagDef\doDBUpdates(), DeleteAutoPatrolLogs\execute(), and CopyFileBackend\execute().
Maintenance::setConfig | ( | Config | $config | ) |
Config | $config |
Definition at line 586 of file Maintenance.php.
References $config.
Maintenance::setDB | ( | IDatabase | $db | ) |
Sets database object to be returned by getDB().
IDatabase | $db |
Reimplemented in BackupDumper.
Definition at line 1364 of file Maintenance.php.
Referenced by DatabaseUpdater\__construct().
LBFactory | $LBFactory | |
Config | $config |
Definition at line 650 of file Maintenance.php.
References $config, $services, MediaWiki\emitBufferedStatsdData(), Config\get(), DeferredUpdates\tryOpportunisticExecute(), and use.
Referenced by setAgentAndTriggers(), and MediaWikiTestCase\setUp().
|
private |
Helper function used solely by loadParamsAndArgs to prevent code duplication.
This sets the param in the options array based on whether or not it can be specified multiple times.
array | $options | |
string | $option | |
mixed | $value |
Definition at line 920 of file Maintenance.php.
References $options, $value, error(), and maybeHelp().
Referenced by loadWithArgv().
Maintenance::setup | ( | ) |
Do some sanity checking and basic setup.
Definition at line 714 of file Maintenance.php.
References $IP, $wgCommandLineMode, adjustMemoryLimit(), fatalError(), loadParamsAndArgs(), maybeHelp(), and validateParamsAndArgs().
|
static |
Should we execute the maintenance script, or just allow it to be included as a standalone class? It checks that the call stack only includes this function and "requires" (meaning was called from the file scope)
Definition at line 179 of file Maintenance.php.
References $wgCommandLineMode, class, and captcha-old\count.
|
protected |
Checks to see if a particular option in supported.
Normally this means it has been registered by the script via addOption.
string | $name | The name of the option |
Definition at line 221 of file Maintenance.php.
References $name.
Referenced by validateParamsAndArgs().
|
private |
Unlock the tables.
IMaintainableDatabase | &$db |
Definition at line 1439 of file Maintenance.php.
Referenced by relockSearchindex(), and updateSearchIndex().
Maintenance::updateSearchIndex | ( | $maxLockTime, | |
$callback, | |||
$dbw, | |||
$results | |||
) |
Perform a search index update with locking.
int | $maxLockTime | The maximum time to keep the search index locked. |
string | $callback | The function that will update the function. |
IMaintainableDatabase | $dbw | |
array | $results |
Definition at line 1460 of file Maintenance.php.
References as, lockSearchindex(), output(), relockSearchindex(), and unlockSearchindex().
Referenced by UpdateSearchIndex\doUpdateSearchIndex(), and UpdateDoubleWidthSearch\execute().
Maintenance::updateSearchIndexForPage | ( | $dbw, | |
$pageId | |||
) |
Update the searchindex table for a given pageid.
IDatabase | $dbw | A database write handle |
int | $pageId | The page ID to update. |
Definition at line 1497 of file Maintenance.php.
References $rev, $title, Revision\loadFromPageId(), and output().
Referenced by UpdateDoubleWidthSearch\searchIndexUpdateCallback(), and UpdateSearchIndex\searchIndexUpdateCallback().
|
protected |
Run some validation checks on the params, etc.
Reimplemented in CommandLineInstaller, and GetConfiguration.
Definition at line 982 of file Maintenance.php.
References $opt, as, error(), hasArg(), hasOption(), maybeHelp(), and supportsOption().
Referenced by setup().
|
private |
Definition at line 470 of file Maintenance.php.
|
private |
Accessible via getConfig()
Definition at line 136 of file Maintenance.php.
Referenced by BenchmarkTidy\execute(), MediaWikiShell\execute(), getConfig(), setConfig(), setLBFactoryTriggers(), and UpdateExtensionJsonSchema\updateTo2().
resource Maintenance::$fileHandle |
Used when creating separate schema files.
Definition at line 129 of file Maintenance.php.
|
private |
Definition at line 471 of file Maintenance.php.
|
private |
UNIX timestamp.
Definition at line 123 of file Maintenance.php.
|
protected |
Definition at line 88 of file Maintenance.php.
|
protected |
Definition at line 79 of file Maintenance.php.
|
protected |
Definition at line 85 of file Maintenance.php.
Referenced by JSParseHelper\execute(), and CommandLineInc\execute().
|
protected |
Batch size.
If a script supports this, they should set a default with setBatchSize()
Definition at line 109 of file Maintenance.php.
Referenced by PopulateExternallinksIndex60\doDBUpdates(), and getBatchSize().
|
private |
Maintenance::$mDbPass |
Definition at line 95 of file Maintenance.php.
Referenced by finalSetup().
|
protected |
Definition at line 95 of file Maintenance.php.
Referenced by finalSetup().
|
private |
Definition at line 114 of file Maintenance.php.
Referenced by maybeHelp().
|
protected |
Definition at line 98 of file Maintenance.php.
|
private |
Definition at line 112 of file Maintenance.php.
|
protected |
Definition at line 101 of file Maintenance.php.
|
protected |
Definition at line 82 of file Maintenance.php.
Referenced by CommandLineInc\execute().
|
protected |
Definition at line 73 of file Maintenance.php.
Referenced by addDefaultParams().
|
protected |
Definition at line 94 of file Maintenance.php.
Referenced by isQuiet().
|
protected |
Definition at line 91 of file Maintenance.php.
Referenced by getName().
|
protected |
Definition at line 76 of file Maintenance.php.
array Maintenance::$orderedOptions = [] |
Used to read the options in the order they were passed.
Useful for option chaining (Ex. dumpBackup.php). It will be an empty array if the options are passed in through loadParamsAndArgs( $self, $opts, $args ).
This is an array of arrays where 0 => the option and 1 => parameter value.
Definition at line 155 of file Maintenance.php.
Referenced by BackupDumper\processOptions().
|
private |
Definition at line 142 of file Maintenance.php.
const Maintenance::DB_ADMIN = 2 |
Definition at line 67 of file Maintenance.php.
Referenced by RebuildAll\getDbType(), RenameDbPrefix\getDbType(), AlterSharedConstraints\getDbType(), PatchSql\getDbType(), UpdateDoubleWidthSearch\getDbType(), RebuildTextIndex\getDbType(), UpdateSearchIndex\getDbType(), UpdateMediaWiki\getDbType(), CleanupArchiveUserText\getDbType(), ConvertLinks\getDbType(), PHPUnitMaintClass\getDbType(), RunBatchedQuery\getDbType(), and MwSql\getDbType().
const Maintenance::DB_NONE = 0 |
Constants for DB access type.
Definition at line 65 of file Maintenance.php.
Referenced by DumpIterator\finalSetup(), GenerateRandomImages\getDbType(), GenerateNormalizerDataMl\getDbType(), GenerateNormalizerDataAr\getDbType(), SqliteMaintenance\getDbType(), PreprocessDump\getDbType(), FindHooks\getDbType(), MWDocGen\getDbType(), CommandLineInstaller\getDbType(), and SearchDump\getDbType().
const Maintenance::DB_STD = 1 |
Definition at line 66 of file Maintenance.php.
Referenced by getDbType().
const Maintenance::STDIN_ALL = 'all' |
Definition at line 70 of file Maintenance.php.
Referenced by EditCLI\execute().