MediaWiki REL1_33
|
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort. More...
Inherited by AddChangeTag, AddSite, AllTrans, AlterSharedConstraints, AttachLatest, BackupDumper, BackupReader, BenchmarkParse, Benchmarker, CLIParser, CategoryChangesAsRdf, ChangePassword, CheckBadRedirects, CheckComposerLockUpToDate, CheckImages, CheckLess, CheckUsernames, Cleanup, CleanupAncientTables, CleanupArchiveUserText, CleanupBlocks, CleanupInvalidDbKeys, CleanupPreferences, CleanupRemovedModules, CleanupSpam, CleanupUploadStash, ClearInterwikiCache, 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, GenerateSitemap, GetConfiguration, GetLagTimes, GetReplicaServer, GetTextMaint, HHVMMakeRepo, ImageBuilder, ImportImages, ImportSiteScripts, ImportSites, ImportTextFiles, InitEditCount, InitSiteStats, InitUserPreference, InvalidateUserSesssions, JSParseHelper, LangMemUsage, ListVariants, LoggedUpdateMaintenance, MWDocGen, MakeTestEdits, ManageForeignResources, ManageJobs, McTest, MediaWikiShell, MergeMessageFileList, MigrateFileRepoLayout, MigrateUserGroup, MinifyScript, MoveBatch, MwSql, MysqlMaintenance, NamespaceDupes, NukeNS, NukePage, OrphanStats, Orphans, PHPUnitMaintClass, PageExists, ParserEditTests, ParserFuzzTest, ParserTestsMaintenance, PatchSql, PopulateCategory, PopulateContentModel, PopulateContentTables, PopulateInterwiki, Protect, PruneFileCache, PurgeChangedFiles, PurgeChangedPages, PurgeExpiredUserrights, PurgeList, PurgeModuleDeps, PurgeOldText, PurgePage, PurgeParserCache, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RecountCategories, RefreshFileHeaders, RefreshImageMetadata, RefreshLinks, RemoveInvalidEmails, RemoveUnusedAccounts, RenameDbPrefix, RenameUserCleanup, ReplaceAll, ResetAuthenticationThrottle, ResetPageRandom, ResetUserEmail, ResetUserTokens, RollbackEdits, RunBatchedQuery, RunJobs, ShowJobs, ShowSiteStats, SqliteMaintenance, StorageTypeStats, SyncFileBackend, TableCleanup, TidyUpT39714, Undelete, Update, UpdateArticleCount, UpdateCSS, UpdateCollation, UpdateDoubleWidthSearch, UpdateExtensionJsonSchema, UpdateLexerList, UpdateMediaWiki, UpdateRestrictions, UpdateScratchTokenFormat, UpdateSearchIndex, UpdateSpecialPages, UserOptionsMaintenance, ValidateRegistrationFile, ViewCLI, and WrapOldPasswords.
Public Member Functions | |
function | __construct () |
__construct () | |
Default constructor. | |
checkRequiredExtensions () | |
Verify that the required extensions are installed. | |
cleanupChanneled () | |
Clean up channeled output. | |
clearParamsAndArgs () | |
Clear all params and arguments. | |
function | execute () |
execute () | |
Do the actual work. | |
finalSetup () | |
Handle some last-minute setup here. | |
getConfig () | |
getDbType () | |
Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB. | |
getName () | |
Get the script's name. | |
globals () | |
Potentially debug globals. | |
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. | |
loadSettings () | |
Generic setup for most installs. | |
loadWithArgv ( $argv) | |
Load params and arguments from a given array of command-line arguments. | |
memoryLimit () | |
Normally we disable the memory_limit when running admin scripts. | |
outputChanneled ( $msg, $channel=null) | |
Message outputter with channeled message support. | |
purgeRedundantText ( $delete=true) | |
Support function for cleaning up redundant text records. | |
runChild ( $maintClass, $classFile=null) | |
Run a child maintenance script. | |
setAgentAndTriggers () | |
Set triggers like when to try to run deferred updates. | |
setConfig (Config $config) | |
setDB (IDatabase $db) | |
Sets database object to be returned by getDB(). | |
setup () | |
Do some sanity checking and basic setup. | |
updateSearchIndex ( $maxLockTime, $callback, $dbw, $results) | |
Perform a search index update with locking. | |
updateSearchIndexForPage ( $dbw, $pageId) | |
Update the searchindex table for a given pageid. | |
validateParamsAndArgs () | |
Run some validation checks on the params, etc. | |
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). | |
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. | |
static | readconsole ( $prompt='> ') |
Prompt the console for input. | |
static | requireTestsAutoloader () |
Call this to set up the autoloader to allow classes to be used from the tests directory. | |
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) | |
Public Attributes | |
resource | $fileHandle |
Used when creating separate schema files. | |
array | $orderedOptions = [] |
Used to read the options in the order they were passed. | |
const | DB_ADMIN = 2 |
const | DB_NONE = 0 |
Constants for DB access type. | |
const | DB_STD = 1 |
const | STDIN_ALL = 'all' |
Protected Member Functions | |
activateProfiler () | |
Activate the profiler (assuming $wgProfiler is set) | |
addArg ( $arg, $description, $required=true) | |
Add some args that are needed. | |
addDefaultParams () | |
Add the default parameters to the scripts. | |
addDescription ( $text) | |
Set the description text. | |
addOption ( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false) | |
Add a parameter to the script. | |
adjustMemoryLimit () | |
Adjusts PHP's memory limit to better suit our needs, if needed. | |
afterFinalSetup () | |
Execute a callback function at the end of initialisation. | |
beginTransaction (IDatabase $dbw, $fname) | |
Begin a transcation on a DB. | |
commitTransaction (IDatabase $dbw, $fname) | |
Commit the transcation on a DB handle and wait for replica DBs to catch up. | |
countDown ( $seconds) | |
Count down from $seconds to zero on the terminal, with a one-second pause between showing each number. | |
deleteOption ( $name) | |
Remove an option. | |
error ( $err, $die=0) | |
Throw an error to the user. | |
fatalError ( $msg, $exitCode=1) | |
Output a message and terminate the current script. | |
getArg ( $argId=0, $default=null) | |
Get an argument. | |
getBatchSize () | |
Returns batch size. | |
getDB ( $db, $groups=[], $wiki=false) | |
Returns a database to be used by current maintenance script. | |
getDir () | |
Get the maintenance directory. | |
getOption ( $name, $default=null) | |
Get an option, or return the default. | |
getStdin ( $len=null) | |
Return input from stdin. | |
hasArg ( $argId=0) | |
Does a given argument exist? | |
hasOption ( $name) | |
Checks to see if a particular option exists. | |
loadSpecialVars () | |
Handle the special variables that are global to all scripts. | |
maybeHelp ( $force=false) | |
Maybe show the help. | |
output ( $out, $channel=null) | |
Throw some output to the user. | |
requireExtension ( $name) | |
Indicate that the specified extension must be loaded before the script can run. | |
rollbackTransaction (IDatabase $dbw, $fname) | |
Rollback the transcation on a DB handle. | |
setAllowUnregisteredOptions ( $allow) | |
Sets whether to allow unregistered options, which are options passed to a script that do not match an expected parameter. | |
setBatchSize ( $s=0) | |
Set the batch size. | |
supportsOption ( $name) | |
Checks to see if a particular option in supported. | |
Protected Attributes | |
$mAllowUnregisteredOptions = false | |
$mArgList = [] | |
$mArgs = [] | |
int | $mBatchSize = null |
Batch size. | |
$mDbPass | |
$mDbUser | |
$mDescription = '' | |
$mInputLoaded = false | |
$mOptions = [] | |
$mParams = [] | |
$mQuiet = false | |
$mSelf | |
$mShortParamsMap = [] | |
Private Member Functions | |
lockSearchindex ( $db) | |
Lock the search index. | |
relockSearchindex ( $db) | |
Unlock and lock again Since the lock is low-priority, queued reads will be able to complete. | |
setParam (&$options, $option, $value) | |
Helper function used solely by loadParamsAndArgs to prevent code duplication. | |
unlockSearchindex ( $db) | |
Unlock the tables. | |
Static Private Member Functions | |
static | readlineEmulation ( $prompt) |
Emulate readline() | |
Private Attributes | |
$atLineStart = true | |
Config | $config |
Accessible via getConfig() | |
$lastChannel = null | |
float | $lastReplicationWait = 0.0 |
UNIX timestamp. | |
IMaintainableDatabase | $mDb = null |
Used by getDB() / setDB() | |
$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.
Terminology: params: registry of named values that may be passed to the script arg list: registry of positional values that may be passed to the script options: passed param values args: passed positional values
In the command: mwscript somescript.php –foo=bar baz foo is a param bar is the option value of the option for param foo baz is the arg value at index 0 in the arg list
Definition at line 39 of file maintenance.txt.
Maintenance::__construct | ( | ) |
Default constructor.
Children should call this first if implementing their own constructors
Reimplemented in CountFancyCaptchas, DeleteOldFancyCaptchas, GenerateFancyCaptchas, Update, DisableOATHAuthForUser, UpdateScratchTokenFormat, CleanupArchiveUserText, RenameUserCleanup, ReplaceAll, Cleanup, UpdateCSS, UpdateLexerList, AddChangeTag, AddRFCandPMIDInterwiki, AddSite, AttachLatest, BenchmarkDeleteTruncate, BenchHttpHttps, BenchIfSwitch, BenchUtf8TitleCheck, BenchWfIsWindows, BenchWikimediaBaseConvert, BenchmarkCSSMin, Benchmarker, BenchmarkHooks, BenchmarkJavaScriptMinifier, BenchmarkJSMinPlus, BenchmarkLruHash, BenchmarkParse, BenchmarkPurge, BenchmarkSanitizer, BenchmarkStringReplacement, BenchmarkTidy, BenchmarkTitleValue, CategoryChangesAsRdf, ChangePassword, CheckBadRedirects, CheckComposerLockUpToDate, CheckImages, CheckLess, CheckUsernames, CleanupAncientTables, CleanupBlocks, CleanupCaps, CleanupEmptyCategories, CleanupImages, CleanupInvalidDbKeys, CleanupPreferences, CleanupRemovedModules, CleanupSpam, TableCleanup, TitleCleanup, CleanupUploadStash, CleanupUsersWithNoId, CleanupWatchlist, ClearInterwikiCache, CommandLineInc, CompareParserCache, CompareParsers, ConvertExtensionToRegistration, ConvertLinks, ConvertUserOptions, CopyFileBackend, CopyJobQueue, CreateAndPromote, CreateCommonPasswordCdb, DeduplicateArchiveRevId, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteAutoPatrolLogs, DeleteBatch, DeleteDefaultMessages, DeleteEqualMessages, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteSelfExternals, DumpCategoriesAsRdf, DumpIterator, SearchDump, DumpLinks, DumpUploads, EditCLI, EmptyUserGroup, EraseArchivedFile, ExportSites, FetchText, FileOpPerfTest, FindDeprecated, FindHooks, FindMissingFiles, FindOrphanedFiles, FixDefaultJsonContentPages, FixDoubleRedirects, FixExtLinksProtocolRelative, FixTimestamps, FixUserRegistration, FormatInstallDoc, GenerateJsonI18n, GenerateSitemap, GetConfiguration, GetLagTimes, GetReplicaServer, GetTextMaint, HHVMMakeRepo, BackupReader, ImportImages, ImportSites, ImportSiteScripts, ImportTextFiles, DeleteLocalPasswords, MigrateActors, InitEditCount, InitSiteStats, InitUserPreference, CommandLineInstaller, InvalidateUserSesssions, JSParseHelper, DatabaseLag, AllTrans, DateFormats, Digit2Html, DumpMessages, GenerateCollationData, GenerateNormalizerDataAr, GenerateNormalizerDataMl, LangMemUsage, ListVariants, LoggedUpdateMaintenance, MakeTestEdits, ManageForeignResources, ManageJobs, McTest, MergeMessageFileList, MigrateArchiveText, MigrateComments, MigrateFileRepoLayout, MigrateImageCommentTemp, MigrateUserGroup, MinifyScript, MoveBatch, MWDocGen, MysqlMaintenance, NamespaceDupes, NukeNS, NukePage, AlterSharedConstraints, Orphans, PageExists, CLIParser, PatchSql, PopulateArchiveRevId, PopulateBacklinkNamespace, PopulateCategory, PopulateChangeTagDef, PopulateContentModel, PopulateContentTables, PopulateExternallinksIndex60, PopulateFilearchiveSha1, PopulateImageSha1, PopulateInterwiki, PopulateIpChanges, PopulateLogSearch, PopulateLogUsertext, PopulateParentId, PopulatePPSortKey, PopulateRecentChangesSource, PopulateRevisionLength, PopulateRevisionSha1, PreprocessDump, Protect, PruneFileCache, PurgeChangedFiles, PurgeChangedPages, PurgeExpiredUserrights, PurgeList, PurgeModuleDeps, PurgeOldText, PurgePage, PurgeParserCache, ReassignEdits, RebuildAll, RebuildFileCache, ImageBuilder, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RecountCategories, RefreshExternallinksIndex, RefreshFileHeaders, RefreshImageMetadata, RefreshLinks, RemoveInvalidEmails, RemoveUnusedAccounts, RenameDbPrefix, DumpRenderer, ResetAuthenticationThrottle, ResetPageRandom, ResetUserEmail, ResetUserTokens, RollbackEdits, RunBatchedQuery, RunJobs, MediaWikiShell, ShowJobs, ShowSiteStats, MwSql, SqliteMaintenance, CompressOld, DumpRev, FixT22757, OrphanStats, SyncFileBackend, Undelete, UpdateMediaWiki, UpdateArticleCount, UpdateCollation, UpdateDoubleWidthSearch, UpdateExtensionJsonSchema, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, UserOptionsMaintenance, ValidateRegistrationFile, ViewCLI, WrapOldPasswords, ParserEditTests, ParserFuzzTest, ParserTestsMaintenance, PHPUnitMaintClass, and GenerateJqueryMsgData.
Definition at line 173 of file Maintenance.php.
References $IP, addDefaultParams(), and and().
|
inline |
Definition at line 41 of file maintenance.txt.
|
protected |
Activate the profiler (assuming $wgProfiler is set)
Definition at line 813 of file Maintenance.php.
References $output, $wgProfileLimit, $wgProfiler, $wgTrxProfilerLimits, and(), and getOption().
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 300 of file Maintenance.php.
References and().
Referenced by DisableOATHAuthForUser\__construct(), ReplaceAll\__construct(), AddSite\__construct(), BenchmarkParse\__construct(), CleanupSpam\__construct(), ConvertExtensionToRegistration\__construct(), ConvertLinks\__construct(), CreateAndPromote\__construct(), CreateCommonPasswordCdb\__construct(), DeleteBatch\__construct(), EditCLI\__construct(), EmptyUserGroup\__construct(), ExportSites\__construct(), FixTimestamps\__construct(), FormatInstallDoc\__construct(), GenerateJsonI18n\__construct(), GetTextMaint\__construct(), BackupReader\__construct(), ImportImages\__construct(), ImportSites\__construct(), ImportSiteScripts\__construct(), ImportTextFiles\__construct(), CommandLineInstaller\__construct(), JSParseHelper\__construct(), ManageForeignResources\__construct(), McTest\__construct(), MigrateUserGroup\__construct(), MoveBatch\__construct(), MysqlMaintenance\__construct(), NukePage\__construct(), PageExists\__construct(), CLIParser\__construct(), PatchSql\__construct(), Protect\__construct(), ReassignEdits\__construct(), RefreshLinks\__construct(), ResetUserEmail\__construct(), DumpRev\__construct(), Undelete\__construct(), UpdateExtensionJsonSchema\__construct(), UserOptionsMaintenance\__construct(), ValidateRegistrationFile\__construct(), and ViewCLI\__construct().
|
protected |
Add the default parameters to the scripts.
Definition at line 551 of file Maintenance.php.
References $mParams, addOption(), and(), and getDbType().
Referenced by __construct().
|
protected |
Set the description text.
string | $text | The text of the description |
Definition at line 329 of file Maintenance.php.
Referenced by DumpBackup\__construct(), TextPassDumper\__construct(), CleanupArchiveUserText\__construct(), RenameUserCleanup\__construct(), UpdateCSS\__construct(), UpdateLexerList\__construct(), AddChangeTag\__construct(), AddRFCandPMIDInterwiki\__construct(), AddSite\__construct(), AttachLatest\__construct(), BenchmarkDeleteTruncate\__construct(), BenchHttpHttps\__construct(), BenchIfSwitch\__construct(), BenchUtf8TitleCheck\__construct(), BenchWfIsWindows\__construct(), BenchWikimediaBaseConvert\__construct(), BenchmarkCSSMin\__construct(), BenchmarkHooks\__construct(), BenchmarkJavaScriptMinifier\__construct(), BenchmarkJSMinPlus\__construct(), BenchmarkLruHash\__construct(), BenchmarkParse\__construct(), BenchmarkPurge\__construct(), BenchmarkSanitizer\__construct(), BenchmarkStringReplacement\__construct(), BenchmarkTitleValue\__construct(), CategoryChangesAsRdf\__construct(), ChangePassword\__construct(), CheckBadRedirects\__construct(), CheckComposerLockUpToDate\__construct(), CheckImages\__construct(), CheckLess\__construct(), CheckUsernames\__construct(), CleanupAncientTables\__construct(), CleanupBlocks\__construct(), CleanupCaps\__construct(), CleanupEmptyCategories\__construct(), CleanupImages\__construct(), CleanupInvalidDbKeys\__construct(), CleanupRemovedModules\__construct(), CleanupSpam\__construct(), TitleCleanup\__construct(), CleanupUploadStash\__construct(), CleanupUsersWithNoId\__construct(), CleanupWatchlist\__construct(), ClearInterwikiCache\__construct(), CompareParserCache\__construct(), CompareParsers\__construct(), ConvertExtensionToRegistration\__construct(), ConvertLinks\__construct(), ConvertUserOptions\__construct(), CopyFileBackend\__construct(), CopyJobQueue\__construct(), CreateAndPromote\__construct(), CreateCommonPasswordCdb\__construct(), DeduplicateArchiveRevId\__construct(), DeleteArchivedFiles\__construct(), DeleteArchivedRevisions\__construct(), DeleteAutoPatrolLogs\__construct(), DeleteBatch\__construct(), DeleteDefaultMessages\__construct(), DeleteEqualMessages\__construct(), DeleteOldRevisions\__construct(), DeleteOrphanedRevisions\__construct(), DeleteSelfExternals\__construct(), DumpCategoriesAsRdf\__construct(), DumpIterator\__construct(), SearchDump\__construct(), DumpLinks\__construct(), DumpUploads\__construct(), EditCLI\__construct(), EmptyUserGroup\__construct(), EraseArchivedFile\__construct(), ExportSites\__construct(), FetchText\__construct(), FileOpPerfTest\__construct(), FindDeprecated\__construct(), FindHooks\__construct(), FindMissingFiles\__construct(), FindOrphanedFiles\__construct(), FixDefaultJsonContentPages\__construct(), FixDoubleRedirects\__construct(), FixExtLinksProtocolRelative\__construct(), FixTimestamps\__construct(), FixUserRegistration\__construct(), GenerateJsonI18n\__construct(), GenerateSitemap\__construct(), GetConfiguration\__construct(), GetLagTimes\__construct(), GetReplicaServer\__construct(), GetTextMaint\__construct(), HHVMMakeRepo\__construct(), BackupReader\__construct(), ImportImages\__construct(), ImportSites\__construct(), ImportSiteScripts\__construct(), ImportTextFiles\__construct(), MigrateActors\__construct(), InitEditCount\__construct(), InitSiteStats\__construct(), CommandLineInstaller\__construct(), InvalidateUserSesssions\__construct(), JSParseHelper\__construct(), DatabaseLag\__construct(), AllTrans\__construct(), DateFormats\__construct(), Digit2Html\__construct(), DumpMessages\__construct(), GenerateNormalizerDataAr\__construct(), GenerateNormalizerDataMl\__construct(), LangMemUsage\__construct(), ListVariants\__construct(), MakeTestEdits\__construct(), ManageForeignResources\__construct(), ManageJobs\__construct(), McTest\__construct(), MergeMessageFileList\__construct(), MigrateArchiveText\__construct(), MigrateComments\__construct(), MigrateFileRepoLayout\__construct(), MigrateImageCommentTemp\__construct(), MigrateUserGroup\__construct(), MinifyScript\__construct(), MoveBatch\__construct(), MWDocGen\__construct(), MysqlMaintenance\__construct(), NamespaceDupes\__construct(), NukeNS\__construct(), NukePage\__construct(), AlterSharedConstraints\__construct(), Orphans\__construct(), PageExists\__construct(), CLIParser\__construct(), PatchSql\__construct(), PopulateArchiveRevId\__construct(), PopulateBacklinkNamespace\__construct(), PopulateCategory\__construct(), PopulateChangeTagDef\__construct(), PopulateContentModel\__construct(), PopulateContentTables\__construct(), PopulateExternallinksIndex60\__construct(), PopulateFilearchiveSha1\__construct(), PopulateImageSha1\__construct(), PopulateInterwiki\__construct(), PopulateIpChanges\__construct(), PopulateLogSearch\__construct(), PopulateLogUsertext\__construct(), PopulateParentId\__construct(), PopulatePPSortKey\__construct(), PopulateRecentChangesSource\__construct(), PopulateRevisionLength\__construct(), PopulateRevisionSha1\__construct(), Protect\__construct(), PruneFileCache\__construct(), PurgeChangedFiles\__construct(), PurgeChangedPages\__construct(), PurgeExpiredUserrights\__construct(), PurgeList\__construct(), PurgeModuleDeps\__construct(), PurgeOldText\__construct(), PurgePage\__construct(), PurgeParserCache\__construct(), ReassignEdits\__construct(), RebuildAll\__construct(), RebuildFileCache\__construct(), ImageBuilder\__construct(), RebuildLocalisationCache\__construct(), RebuildMessages\__construct(), RebuildRecentchanges\__construct(), RebuildTextIndex\__construct(), RecountCategories\__construct(), RefreshExternallinksIndex\__construct(), RefreshFileHeaders\__construct(), RefreshImageMetadata\__construct(), RefreshLinks\__construct(), DumpRenderer\__construct(), ResetAuthenticationThrottle\__construct(), ResetPageRandom\__construct(), ResetUserEmail\__construct(), ResetUserTokens\__construct(), RollbackEdits\__construct(), RunBatchedQuery\__construct(), RunJobs\__construct(), ShowJobs\__construct(), ShowSiteStats\__construct(), MwSql\__construct(), SqliteMaintenance\__construct(), CompressOld\__construct(), FixT22757\__construct(), OrphanStats\__construct(), SyncFileBackend\__construct(), Undelete\__construct(), UpdateMediaWiki\__construct(), UpdateArticleCount\__construct(), UpdateCollation\__construct(), UpdateDoubleWidthSearch\__construct(), UpdateExtensionJsonSchema\__construct(), UpdateRestrictions\__construct(), UpdateSearchIndex\__construct(), UserOptionsMaintenance\__construct(), ViewCLI\__construct(), WrapOldPasswords\__construct(), ParserFuzzTest\__construct(), and ParserTestsMaintenance\__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 248 of file Maintenance.php.
Referenced by DumpBackup\__construct(), TextPassDumper\__construct(), BackupDumper\__construct(), DeleteOldFancyCaptchas\__construct(), GenerateFancyCaptchas\__construct(), Update\__construct(), RenameUserCleanup\__construct(), ReplaceAll\__construct(), Cleanup\__construct(), AddChangeTag\__construct(), AddSite\__construct(), AttachLatest\__construct(), BenchWikimediaBaseConvert\__construct(), BenchmarkCSSMin\__construct(), Benchmarker\__construct(), BenchmarkJavaScriptMinifier\__construct(), BenchmarkJSMinPlus\__construct(), BenchmarkLruHash\__construct(), BenchmarkParse\__construct(), BenchmarkSanitizer\__construct(), BenchmarkTidy\__construct(), CategoryChangesAsRdf\__construct(), ChangePassword\__construct(), CleanupAncientTables\__construct(), CleanupCaps\__construct(), CleanupInvalidDbKeys\__construct(), CleanupPreferences\__construct(), CleanupSpam\__construct(), TableCleanup\__construct(), CleanupUsersWithNoId\__construct(), CleanupWatchlist\__construct(), CommandLineInc\__construct(), CompareParserCache\__construct(), CompareParsers\__construct(), ConvertExtensionToRegistration\__construct(), CopyFileBackend\__construct(), CopyJobQueue\__construct(), CreateAndPromote\__construct(), CreateCommonPasswordCdb\__construct(), DeleteArchivedFiles\__construct(), DeleteArchivedRevisions\__construct(), DeleteAutoPatrolLogs\__construct(), DeleteBatch\__construct(), DeleteDefaultMessages\__construct(), DeleteEqualMessages\__construct(), DeleteOldRevisions\__construct(), DeleteOrphanedRevisions\__construct(), DumpCategoriesAsRdf\__construct(), DumpIterator\__construct(), SearchDump\__construct(), DumpUploads\__construct(), EditCLI\__construct(), EraseArchivedFile\__construct(), FileOpPerfTest\__construct(), FindHooks\__construct(), FindMissingFiles\__construct(), FindOrphanedFiles\__construct(), FixDoubleRedirects\__construct(), FormatInstallDoc\__construct(), GenerateJsonI18n\__construct(), GenerateSitemap\__construct(), GetConfiguration\__construct(), GetLagTimes\__construct(), GetReplicaServer\__construct(), GetTextMaint\__construct(), HHVMMakeRepo\__construct(), BackupReader\__construct(), ImportImages\__construct(), ImportSiteScripts\__construct(), ImportTextFiles\__construct(), DeleteLocalPasswords\__construct(), MigrateActors\__construct(), InitEditCount\__construct(), InitSiteStats\__construct(), InitUserPreference\__construct(), CommandLineInstaller\__construct(), InvalidateUserSesssions\__construct(), DatabaseLag\__construct(), GenerateCollationData\__construct(), GenerateNormalizerDataAr\__construct(), ListVariants\__construct(), LoggedUpdateMaintenance\__construct(), MakeTestEdits\__construct(), ManageForeignResources\__construct(), ManageJobs\__construct(), McTest\__construct(), MergeMessageFileList\__construct(), MigrateArchiveText\__construct(), MigrateFileRepoLayout\__construct(), MinifyScript\__construct(), MoveBatch\__construct(), MWDocGen\__construct(), MysqlMaintenance\__construct(), NamespaceDupes\__construct(), NukeNS\__construct(), NukePage\__construct(), Orphans\__construct(), CLIParser\__construct(), PopulateBacklinkNamespace\__construct(), PopulateChangeTagDef\__construct(), PopulateContentModel\__construct(), PopulateContentTables\__construct(), PopulateImageSha1\__construct(), PopulateInterwiki\__construct(), PopulateIpChanges\__construct(), PreprocessDump\__construct(), Protect\__construct(), PruneFileCache\__construct(), PurgeChangedFiles\__construct(), PurgeChangedPages\__construct(), PurgeList\__construct(), PurgeOldText\__construct(), PurgePage\__construct(), PurgeParserCache\__construct(), ReassignEdits\__construct(), RebuildFileCache\__construct(), ImageBuilder\__construct(), RebuildLocalisationCache\__construct(), RebuildRecentchanges\__construct(), RecountCategories\__construct(), RefreshFileHeaders\__construct(), RefreshImageMetadata\__construct(), RefreshLinks\__construct(), RemoveInvalidEmails\__construct(), RemoveUnusedAccounts\__construct(), RenameDbPrefix\__construct(), DumpRenderer\__construct(), ResetAuthenticationThrottle\__construct(), ResetPageRandom\__construct(), ResetUserEmail\__construct(), ResetUserTokens\__construct(), RollbackEdits\__construct(), RunBatchedQuery\__construct(), RunJobs\__construct(), MediaWikiShell\__construct(), ShowJobs\__construct(), MwSql\__construct(), SqliteMaintenance\__construct(), CompressOld\__construct(), FixT22757\__construct(), SyncFileBackend\__construct(), Undelete\__construct(), UpdateMediaWiki\__construct(), UpdateArticleCount\__construct(), UpdateCollation\__construct(), UpdateDoubleWidthSearch\__construct(), UpdateSearchIndex\__construct(), UpdateSpecialPages\__construct(), UserOptionsMaintenance\__construct(), WrapOldPasswords\__construct(), ParserEditTests\__construct(), ParserFuzzTest\__construct(), ParserTestsMaintenance\__construct(), addDefaultParams(), setBatchSize(), and UpdateMediaWiki\validateParamsAndArgs().
|
protected |
Adjusts PHP's memory limit to better suit our needs, if needed.
Definition at line 800 of file Maintenance.php.
References and(), and memoryLimit().
Referenced by finalSetup(), and setup().
|
protected |
Execute a callback function at the end of initialisation.
Reimplemented in UpdateMediaWiki.
Definition at line 1231 of file Maintenance.php.
References and().
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 1399 of file Maintenance.php.
References $fname, and Wikimedia\Rdbms\IDatabase\begin().
Referenced by CleanupSpam\cleanupArticle(), CompressOld\compressWithConcat(), CleanupPreferences\deleteByWhere(), NukePage\deleteRevisions(), DeduplicateArchiveRevId\doDBUpdates(), MigrateArchiveText\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), CleanupRemovedModules\execute(), DeleteArchivedFiles\execute(), DeleteOrphanedRevisions\execute(), MigrateUserGroup\execute(), MoveBatch\execute(), NukeNS\execute(), NukePage\execute(), PurgeModuleDeps\execute(), RebuildFileCache\execute(), FixT22757\execute(), UpdateCollation\execute(), WrapOldPasswords\execute(), RemoveUnusedAccounts\isInactiveAccount(), NamespaceDupes\mergePage(), MigrateActors\migrateToTemp(), MigrateComments\migrateToTemp(), CleanupImages\pokeFile(), PopulateContentTables\populateContentTablesForRowBatch(), purgeRedundantText(), and RenameUserCleanup\updateTable().
Maintenance::checkRequiredExtensions | ( | ) |
Verify that the required extensions are installed.
Definition at line 628 of file Maintenance.php.
References $name, fatalError(), and ExtensionRegistry\getInstance().
Maintenance::cleanupChanneled | ( | ) |
Clean up channeled output.
Output a newline if necessary.
Definition at line 496 of file Maintenance.php.
References print.
Referenced by output(), and outputChanneled().
Maintenance::clearParamsAndArgs | ( | ) |
Clear all params and arguments.
Definition at line 841 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 1414 of file Maintenance.php.
References $fname, and(), and Wikimedia\Rdbms\IDatabase\commit().
Referenced by CleanupSpam\cleanupArticle(), CompressOld\compressWithConcat(), CleanupPreferences\deleteByWhere(), NukePage\deleteRevisions(), DeduplicateArchiveRevId\doDBUpdates(), MigrateArchiveText\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), CleanupRemovedModules\execute(), DeleteArchivedFiles\execute(), DeleteOrphanedRevisions\execute(), DeleteSelfExternals\execute(), MigrateUserGroup\execute(), MoveBatch\execute(), NukeNS\execute(), NukePage\execute(), PurgeModuleDeps\execute(), RebuildFileCache\execute(), FixT22757\execute(), UpdateCollation\execute(), WrapOldPasswords\execute(), RemoveUnusedAccounts\isInactiveAccount(), NamespaceDupes\mergePage(), MigrateActors\migrateToTemp(), MigrateComments\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.
int | $seconds |
Definition at line 1545 of file Maintenance.php.
References and(), isQuiet(), and output().
Referenced by DeleteAutoPatrolLogs\execute(), ResetUserTokens\execute(), UpdateMediaWiki\execute(), and UserOptionsMaintenance\warn().
|
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 312 of file Maintenance.php.
References and().
|
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 462 of file Maintenance.php.
References and(), fatalError(), outputChanneled(), print, and wfDeprecated().
|
inline |
Definition at line 45 of file maintenance.txt.
|
abstract |
Do the actual work.
All child classes will need to implement this
Reimplemented in CountFancyCaptchas, DeleteOldFancyCaptchas, GenerateFancyCaptchas, Update, DisableOATHAuthForUser, UpdateScratchTokenFormat, CleanupArchiveUserText, RenameUserCleanup, ReplaceAll, Cleanup, UpdateCSS, UpdateLexerList, AddChangeTag, AddSite, AttachLatest, BenchmarkDeleteTruncate, BenchHttpHttps, BenchIfSwitch, BenchUtf8TitleCheck, BenchWfIsWindows, BenchWikimediaBaseConvert, BenchmarkCSSMin, BenchmarkHooks, BenchmarkJavaScriptMinifier, BenchmarkJSMinPlus, BenchmarkLruHash, BenchmarkParse, BenchmarkPurge, BenchmarkSanitizer, BenchmarkStringReplacement, BenchmarkTidy, BenchmarkTitleValue, CategoryChangesAsRdf, ChangePassword, CheckBadRedirects, CheckComposerLockUpToDate, CheckImages, CheckLess, CheckUsernames, CleanupAncientTables, CleanupBlocks, CleanupCaps, CleanupInvalidDbKeys, CleanupPreferences, CleanupRemovedModules, CleanupSpam, TableCleanup, CleanupUploadStash, CleanupWatchlist, ClearInterwikiCache, CommandLineInc, CompareParserCache, ConvertExtensionToRegistration, ConvertLinks, ConvertUserOptions, CopyFileBackend, CopyJobQueue, CreateAndPromote, CreateCommonPasswordCdb, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteAutoPatrolLogs, DeleteBatch, DeleteDefaultMessages, DeleteEqualMessages, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteSelfExternals, DumpBackup, DumpCategoriesAsRdf, DumpIterator, DumpLinks, TextPassDumper, DumpUploads, EditCLI, EmptyUserGroup, EraseArchivedFile, ExportSites, FetchText, FileOpPerfTest, FindDeprecated, FindHooks, FindMissingFiles, FindOrphanedFiles, FixDoubleRedirects, FixTimestamps, FixUserRegistration, FormatInstallDoc, GenerateJsonI18n, GenerateSitemap, GetConfiguration, GetLagTimes, GetReplicaServer, GetTextMaint, HHVMMakeRepo, BackupReader, ImportImages, ImportSites, ImportSiteScripts, ImportTextFiles, BackupDumper, DeleteLocalPasswords, InitEditCount, InitSiteStats, InitUserPreference, CommandLineInstaller, InvalidateUserSesssions, JSParseHelper, DatabaseLag, AllTrans, DateFormats, Digit2Html, DumpMessages, GenerateCollationData, GenerateNormalizerDataAr, GenerateNormalizerDataMl, LangMemUsage, ListVariants, FakeMaintenance, LoggedUpdateMaintenance, MakeTestEdits, ManageForeignResources, ManageJobs, McTest, MergeMessageFileList, MigrateFileRepoLayout, MigrateUserGroup, MinifyScript, MoveBatch, MWDocGen, MysqlMaintenance, NamespaceDupes, NukeNS, NukePage, AlterSharedConstraints, Orphans, PageExists, CLIParser, PatchSql, PopulateCategory, PopulateContentModel, PopulateContentTables, PopulateImageSha1, PopulateInterwiki, Protect, PruneFileCache, PurgeChangedFiles, PurgeChangedPages, PurgeExpiredUserrights, PurgeList, PurgeModuleDeps, PurgeOldText, PurgePage, PurgeParserCache, ReassignEdits, RebuildAll, RebuildFileCache, ImageBuilder, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RecountCategories, RefreshFileHeaders, RefreshImageMetadata, RefreshLinks, RemoveInvalidEmails, RemoveUnusedAccounts, RenameDbPrefix, DumpRenderer, ResetAuthenticationThrottle, ResetPageRandom, ResetUserEmail, ResetUserTokens, RollbackEdits, RunBatchedQuery, RunJobs, MediaWikiShell, ShowJobs, ShowSiteStats, MwSql, SqliteMaintenance, CompressOld, DumpRev, FixT22757, OrphanStats, StorageTypeStats, SyncFileBackend, TidyUpT39714, Undelete, UpdateMediaWiki, UpdateArticleCount, UpdateCollation, UpdateDoubleWidthSearch, UpdateExtensionJsonSchema, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, UserOptionsMaintenance, ValidateRegistrationFile, ViewCLI, WrapOldPasswords, ParserEditTests, ParserFuzzTest, ParserTestsMaintenance, GenerateRandomImages, PHPUnitMaintClass, and GenerateJqueryMsgData.
|
protected |
Output a message and terminate the current script.
string | $msg | Error message |
int | $exitCode | PHP exit status. Should be in range 1-254. |
Definition at line 485 of file Maintenance.php.
Referenced by CompareParsers\checkOptions(), checkRequiredExtensions(), ResetAuthenticationThrottle\clearLoginThrottle(), UpdateMediaWiki\compatChecks(), CopyFileBackend\copyFileBatch(), CopyFileBackend\delFileBatch(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), error(), Cleanup\execute(), AddChangeTag\execute(), BenchmarkJavaScriptMinifier\execute(), BenchmarkJSMinPlus\execute(), BenchmarkParse\execute(), BenchmarkPurge\execute(), BenchmarkTidy\execute(), ChangePassword\execute(), CheckComposerLockUpToDate\execute(), CleanupSpam\execute(), CleanupUploadStash\execute(), ConvertExtensionToRegistration\execute(), CopyFileBackend\execute(), CopyJobQueue\execute(), CreateAndPromote\execute(), CreateCommonPasswordCdb\execute(), DeleteBatch\execute(), DeleteDefaultMessages\execute(), DeleteEqualMessages\execute(), DumpBackup\execute(), DumpIterator\execute(), EditCLI\execute(), EraseArchivedFile\execute(), ExportSites\execute(), FindHooks\execute(), FindOrphanedFiles\execute(), FixDoubleRedirects\execute(), FixTimestamps\execute(), FormatInstallDoc\execute(), GenerateJsonI18n\execute(), GenerateSitemap\execute(), GetTextMaint\execute(), HHVMMakeRepo\execute(), BackupReader\execute(), ImportImages\execute(), ImportTextFiles\execute(), InvalidateUserSesssions\execute(), GenerateCollationData\execute(), GenerateNormalizerDataAr\execute(), LangMemUsage\execute(), MakeTestEdits\execute(), ManageJobs\execute(), McTest\execute(), MergeMessageFileList\execute(), MigrateFileRepoLayout\execute(), MigrateUserGroup\execute(), MinifyScript\execute(), MoveBatch\execute(), MWDocGen\execute(), PopulateContentModel\execute(), Protect\execute(), PruneFileCache\execute(), PurgeParserCache\execute(), RebuildFileCache\execute(), RebuildLocalisationCache\execute(), RebuildRecentchanges\execute(), RebuildTextIndex\execute(), RecountCategories\execute(), RefreshImageMetadata\execute(), RefreshLinks\execute(), RemoveUnusedAccounts\execute(), RenameDbPrefix\execute(), ResetAuthenticationThrottle\execute(), ResetUserEmail\execute(), RollbackEdits\execute(), RunJobs\execute(), MediaWikiShell\execute(), MwSql\execute(), CompressOld\execute(), DumpRev\execute(), OrphanStats\execute(), SyncFileBackend\execute(), Undelete\execute(), UpdateMediaWiki\execute(), UpdateDoubleWidthSearch\execute(), UpdateExtensionJsonSchema\execute(), UpdateRestrictions\execute(), UpdateSpecialPages\execute(), ValidateRegistrationFile\execute(), ViewCLI\execute(), WrapOldPasswords\execute(), GenerateCollationData\generateFirstChars(), 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, RebuildFileCache, RebuildLocalisationCache, ParserEditTests, ParserFuzzTest, ParserTestsMaintenance, and PHPUnitMaintClass.
Definition at line 1158 of file Maintenance.php.
References $mDbPass, $mDbUser, $wgCommandLineMode, $wgDBadminpassword, $wgDBadminuser, $wgDBDefaultGroup, $wgDBpassword, $wgDBservers, $wgDBuser, $wgLBFactoryConf, $wgServer, $wgShowExceptionDetails, $wgShowHostnames, activateProfiler(), adjustMemoryLimit(), afterFinalSetup(), and(), 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 352 of file Maintenance.php.
References and(), hasArg(), and wfDeprecated().
Referenced by DisableOATHAuthForUser\execute(), AddSite\execute(), BenchmarkParse\execute(), CleanupSpam\execute(), ConvertExtensionToRegistration\execute(), ConvertLinks\execute(), CreateAndPromote\execute(), CreateCommonPasswordCdb\execute(), DeleteBatch\execute(), EditCLI\execute(), EmptyUserGroup\execute(), ExportSites\execute(), FixTimestamps\execute(), FormatInstallDoc\execute(), GenerateJsonI18n\execute(), GetTextMaint\execute(), BackupReader\execute(), ImportImages\execute(), ImportSites\execute(), ImportSiteScripts\execute(), ImportTextFiles\execute(), CommandLineInstaller\execute(), ManageForeignResources\execute(), McTest\execute(), MigrateUserGroup\execute(), MinifyScript\execute(), MoveBatch\execute(), NukePage\execute(), PageExists\execute(), Protect\execute(), ReassignEdits\execute(), RefreshLinks\execute(), ResetUserEmail\execute(), MwSql\execute(), DumpRev\execute(), Undelete\execute(), UpdateExtensionJsonSchema\execute(), ValidateRegistrationFile\execute(), ViewCLI\execute(), ImportSiteScripts\fetchScriptList(), ReplaceAll\getReplacement(), ReplaceAll\getTarget(), UserOptionsMaintenance\showUsageStats(), UserOptionsMaintenance\updateOptions(), and CLIParser\Wikitext().
|
protected |
Returns batch size.
Definition at line 367 of file Maintenance.php.
References $mBatchSize.
Referenced by PopulateChangeTagDef\backpopulateChangeTagPerTag(), CopyJobQueue\copyJobs(), DeduplicateArchiveRevId\doDBUpdates(), MigrateArchiveText\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateChangeTagDef\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionLength\doLenUpdates(), PopulateRevisionSha1\doSha1Updates(), RecountCategories\doWork(), CheckUsernames\execute(), CleanupBlocks\execute(), CleanupRemovedModules\execute(), CleanupUploadStash\execute(), CopyFileBackend\execute(), DeleteAutoPatrolLogs\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), InitUserPreference\execute(), InvalidateUserSesssions\execute(), MakeTestEdits\execute(), MigrateFileRepoLayout\execute(), MigrateUserGroup\execute(), PurgeChangedPages\execute(), PurgeModuleDeps\execute(), RebuildFileCache\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), RefreshLinks\execute(), ResetPageRandom\execute(), ResetUserTokens\execute(), UpdateRestrictions\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(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), RebuildRecentchanges\rebuildRecentChangesTablePass5(), RefreshLinks\refreshCategory(), ManageJobs\repushAbandoned(), and SyncFileBackend\syncBackends().
Maintenance::getConfig | ( | ) |
Definition at line 594 of file Maintenance.php.
References $config.
Referenced by ResetAuthenticationThrottle\clearLoginThrottle(), ResetAuthenticationThrottle\clearSignupThrottle(), AddRFCandPMIDInterwiki\doDBUpdates(), FixDefaultJsonContentPages\doDBUpdates(), DumpIterator\execute(), DumpRenderer\execute(), Undelete\execute(), 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 1373 of file Maintenance.php.
References $mDb, and wfGetDB().
Referenced by ImageBuilder\buildTable(), Orphans\checkOrphans(), Orphans\checkSeparation(), CleanupUsersWithNoId\cleanup(), CleanupSpam\cleanupArticle(), CleanupInvalidDbKeys\cleanupTable(), CompressOld\compressOldPages(), CompressOld\compressPage(), CompressOld\compressWithConcat(), ConvertLinks\createTempTable(), RefreshLinks\deleteLinksFromNonexistent(), NukePage\deleteRevisions(), RefreshLinks\dfnCheckInterval(), AddRFCandPMIDInterwiki\doDBUpdates(), DeduplicateArchiveRevId\doDBUpdates(), FixDefaultJsonContentPages\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), MigrateActors\doDBUpdates(), MigrateArchiveText\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateExternallinksIndex60\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), RefreshExternallinksIndex\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), ReassignEdits\doReassignEdits(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), UpdateSearchIndex\doUpdateSearchIndex(), RecountCategories\doWork(), UpdateScratchTokenFormat\execute(), AttachLatest\execute(), BenchmarkDeleteTruncate\execute(), CategoryChangesAsRdf\execute(), CheckBadRedirects\execute(), CheckImages\execute(), CheckUsernames\execute(), CleanupAncientTables\execute(), CleanupBlocks\execute(), CleanupPreferences\execute(), CleanupRemovedModules\execute(), CleanupSpam\execute(), ClearInterwikiCache\execute(), CompareParserCache\execute(), ConvertLinks\execute(), ConvertUserOptions\execute(), DeleteArchivedFiles\execute(), DeleteArchivedRevisions\execute(), DeleteDefaultMessages\execute(), DeleteEqualMessages\execute(), DeleteOrphanedRevisions\execute(), DeleteSelfExternals\execute(), DumpCategoriesAsRdf\execute(), DumpLinks\execute(), EraseArchivedFile\execute(), FixDoubleRedirects\execute(), FixTimestamps\execute(), FixUserRegistration\execute(), GenerateSitemap\execute(), GetReplicaServer\execute(), InitEditCount\execute(), InitSiteStats\execute(), InitUserPreference\execute(), LoggedUpdateMaintenance\execute(), MigrateUserGroup\execute(), MoveBatch\execute(), NamespaceDupes\execute(), NukeNS\execute(), NukePage\execute(), AlterSharedConstraints\execute(), PatchSql\execute(), PopulateCategory\execute(), PopulateContentModel\execute(), PurgeChangedFiles\execute(), PurgeChangedPages\execute(), PurgeModuleDeps\execute(), RebuildAll\execute(), RebuildFileCache\execute(), ImageBuilder\execute(), RebuildTextIndex\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), RemoveInvalidEmails\execute(), RemoveUnusedAccounts\execute(), RenameDbPrefix\execute(), ResetPageRandom\execute(), ResetUserTokens\execute(), RunBatchedQuery\execute(), ShowSiteStats\execute(), SqliteMaintenance\execute(), FixT22757\execute(), StorageTypeStats\execute(), TidyUpT39714\execute(), UpdateMediaWiki\execute(), UpdateArticleCount\execute(), UpdateCollation\execute(), UpdateDoubleWidthSearch\execute(), UpdateRestrictions\execute(), UpdateSpecialPages\execute(), WrapOldPasswords\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(), MigrateActors\migrateToTemp(), MigrateComments\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 CleanupArchiveUserText, ConvertLinks, SearchDump, FindHooks, CommandLineInstaller, GenerateNormalizerDataAr, GenerateNormalizerDataMl, MWDocGen, AlterSharedConstraints, PatchSql, PreprocessDump, RebuildAll, RebuildTextIndex, RenameDbPrefix, RunBatchedQuery, MwSql, SqliteMaintenance, UpdateMediaWiki, UpdateDoubleWidthSearch, UpdateSearchIndex, GenerateRandomImages, and PHPUnitMaintClass.
Definition at line 544 of file Maintenance.php.
References DB_STD.
Referenced by addDefaultParams(), DumpIterator\finalSetup(), and finalSetup().
|
protected |
Get the maintenance directory.
Definition at line 1359 of file Maintenance.php.
References and().
Maintenance::getName | ( | ) |
Get the script's name.
Definition at line 397 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 283 of file Maintenance.php.
References $name, and hasOption().
Referenced by activateProfiler(), PopulateChangeTagDef\backpopulateChangeTagPerTag(), Benchmarker\bench(), CompareParsers\checkOptions(), PreprocessDump\checkOptions(), SqliteMaintenance\checkSyntax(), RenameUserCleanup\checkUserExistence(), CleanupUsersWithNoId\doDBUpdates(), MigrateActors\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateChangeTagDef\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), FileOpPerfTest\doPerfTest(), PurgeList\doPurge(), UpdateSpecialPages\doSpecialPageCacheUpdates(), DeleteOldFancyCaptchas\execute(), GenerateFancyCaptchas\execute(), Update\execute(), RenameUserCleanup\execute(), ReplaceAll\execute(), AddChangeTag\execute(), AddSite\execute(), BenchWikimediaBaseConvert\execute(), BenchmarkCSSMin\execute(), BenchmarkJavaScriptMinifier\execute(), BenchmarkJSMinPlus\execute(), BenchmarkLruHash\execute(), BenchmarkParse\execute(), BenchmarkPurge\execute(), BenchmarkSanitizer\execute(), BenchmarkTidy\execute(), CategoryChangesAsRdf\execute(), ChangePassword\execute(), CleanupCaps\execute(), CleanupInvalidDbKeys\execute(), CompareParserCache\execute(), ConvertExtensionToRegistration\execute(), CopyFileBackend\execute(), CopyJobQueue\execute(), CreateAndPromote\execute(), CreateCommonPasswordCdb\execute(), DeleteAutoPatrolLogs\execute(), DeleteBatch\execute(), DeleteEqualMessages\execute(), DumpCategoriesAsRdf\execute(), DumpIterator\execute(), DumpUploads\execute(), EditCLI\execute(), EraseArchivedFile\execute(), FileOpPerfTest\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), FixDoubleRedirects\execute(), FormatInstallDoc\execute(), GenerateJsonI18n\execute(), GenerateSitemap\execute(), GetConfiguration\execute(), GetReplicaServer\execute(), HHVMMakeRepo\execute(), BackupReader\execute(), ImportImages\execute(), ImportSiteScripts\execute(), ImportTextFiles\execute(), InitUserPreference\execute(), CommandLineInstaller\execute(), InvalidateUserSesssions\execute(), GenerateCollationData\execute(), GenerateNormalizerDataAr\execute(), MakeTestEdits\execute(), ManageJobs\execute(), McTest\execute(), MergeMessageFileList\execute(), MigrateFileRepoLayout\execute(), MinifyScript\execute(), MoveBatch\execute(), MysqlMaintenance\execute(), NamespaceDupes\execute(), NukeNS\execute(), PopulateCategory\execute(), PopulateContentModel\execute(), PopulateContentTables\execute(), PopulateImageSha1\execute(), PopulateInterwiki\execute(), Protect\execute(), PruneFileCache\execute(), PurgeChangedFiles\execute(), PurgeChangedPages\execute(), PurgeList\execute(), PurgeParserCache\execute(), RebuildFileCache\execute(), RebuildLocalisationCache\execute(), RecountCategories\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), RefreshLinks\execute(), RemoveUnusedAccounts\execute(), RenameDbPrefix\execute(), DumpRenderer\execute(), ResetAuthenticationThrottle\execute(), ResetPageRandom\execute(), ResetUserTokens\execute(), RollbackEdits\execute(), RunBatchedQuery\execute(), RunJobs\execute(), ShowJobs\execute(), MwSql\execute(), SqliteMaintenance\execute(), CompressOld\execute(), FixT22757\execute(), SyncFileBackend\execute(), Undelete\execute(), UpdateMediaWiki\execute(), UpdateCollation\execute(), UpdateDoubleWidthSearch\execute(), UpdateSearchIndex\execute(), UpdateSpecialPages\execute(), WrapOldPasswords\execute(), ParserEditTests\execute(), ParserFuzzTest\execute(), ParserTestsMaintenance\execute(), PHPUnitMaintClass\execute(), GetConfiguration\finalSetup(), finalSetup(), 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(), 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 407 of file Maintenance.php.
References $f, $input, and and().
Referenced by PurgeList\doPurge(), DeleteBatch\execute(), DumpIterator\execute(), EditCLI\execute(), FetchText\execute(), MoveBatch\execute(), PurgePage\execute(), and DumpRenderer\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 1651 of file Maintenance.php.
References and(), and wfIsWindows().
Referenced by ParserEditTests\execute().
Maintenance::globals | ( | ) |
Potentially debug globals.
Originally a feature only for refreshLinks
Definition at line 1241 of file Maintenance.php.
References $GLOBALS, and(), and hasOption().
|
protected |
Does a given argument exist?
int | $argId | The integer value (from zero) for the arg |
Definition at line 338 of file Maintenance.php.
References and(), and wfDeprecated().
Referenced by DeleteBatch\execute(), FormatInstallDoc\execute(), BackupReader\execute(), JSParseHelper\execute(), McTest\execute(), MoveBatch\execute(), ReassignEdits\execute(), MwSql\execute(), UserOptionsMaintenance\execute(), getArg(), and validateParamsAndArgs().
|
protected |
Checks to see if a particular option exists.
string | $name | The name of the option |
Definition at line 269 of file Maintenance.php.
References and().
Referenced by PopulateChangeTagDef\backpopulateChangeTagPerTag(), Benchmarker\bench(), CompareParsers\checkOptions(), PreprocessDump\checkOptions(), CleanupSpam\cleanupArticle(), CleanupInvalidDbKeys\cleanupTable(), CopyFileBackend\copyFileBatch(), ConvertLinks\createTempTable(), CleanupPreferences\deleteByWhere(), MigrateArchiveText\doDBUpdates(), PopulateChangeTagDef\doDBUpdates(), PopulateImageSha1\doDBUpdates(), FileOpPerfTest\doPerfTest(), UpdateSpecialPages\doSpecialPageCacheUpdates(), GenerateFancyCaptchas\execute(), Cleanup\execute(), AttachLatest\execute(), BenchmarkCSSMin\execute(), BenchmarkParse\execute(), BenchmarkPurge\execute(), BenchmarkTidy\execute(), ChangePassword\execute(), CleanupAncientTables\execute(), CleanupCaps\execute(), CleanupInvalidDbKeys\execute(), CleanupPreferences\execute(), CleanupSpam\execute(), TableCleanup\execute(), CleanupWatchlist\execute(), ConvertExtensionToRegistration\execute(), ConvertLinks\execute(), CopyFileBackend\execute(), CreateAndPromote\execute(), DeleteArchivedFiles\execute(), DeleteArchivedRevisions\execute(), DeleteAutoPatrolLogs\execute(), DeleteDefaultMessages\execute(), DeleteEqualMessages\execute(), DeleteOldRevisions\execute(), DeleteOrphanedRevisions\execute(), DumpBackup\execute(), DumpIterator\execute(), DumpUploads\execute(), EditCLI\execute(), EraseArchivedFile\execute(), FindOrphanedFiles\execute(), FixDoubleRedirects\execute(), FormatInstallDoc\execute(), GenerateJsonI18n\execute(), GenerateSitemap\execute(), GetLagTimes\execute(), GetReplicaServer\execute(), GetTextMaint\execute(), BackupReader\execute(), ImportImages\execute(), ImportTextFiles\execute(), InitEditCount\execute(), InitSiteStats\execute(), CommandLineInstaller\execute(), DatabaseLag\execute(), GenerateNormalizerDataAr\execute(), ListVariants\execute(), LoggedUpdateMaintenance\execute(), ManageForeignResources\execute(), MergeMessageFileList\execute(), MinifyScript\execute(), MoveBatch\execute(), MysqlMaintenance\execute(), NamespaceDupes\execute(), NukeNS\execute(), NukePage\execute(), Orphans\execute(), PopulateCategory\execute(), PopulateImageSha1\execute(), PopulateInterwiki\execute(), Protect\execute(), PurgeChangedFiles\execute(), PurgeChangedPages\execute(), PurgeList\execute(), PurgeOldText\execute(), ReassignEdits\execute(), RebuildFileCache\execute(), ImageBuilder\execute(), RebuildLocalisationCache\execute(), RebuildRecentchanges\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), RefreshLinks\execute(), RemoveInvalidEmails\execute(), RemoveUnusedAccounts\execute(), DumpRenderer\execute(), ResetUserEmail\execute(), RollbackEdits\execute(), RunJobs\execute(), MediaWikiShell\execute(), ShowJobs\execute(), MwSql\execute(), SqliteMaintenance\execute(), SyncFileBackend\execute(), UpdateMediaWiki\execute(), UpdateArticleCount\execute(), UpdateCollation\execute(), UpdateSearchIndex\execute(), UpdateSpecialPages\execute(), UserOptionsMaintenance\execute(), WrapOldPasswords\execute(), ParserEditTests\execute(), ParserTestsMaintenance\execute(), CopyFileBackend\filesAreSame(), GetConfiguration\finalSetup(), finalSetup(), UpdateCollation\getBatchCondition(), 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(), PurgeChangedFiles\verbose(), and UserOptionsMaintenance\warn().
Maintenance::isQuiet | ( | ) |
Definition at line 424 of file Maintenance.php.
References $mQuiet.
Referenced by countDown(), and SyncFileBackend\execute().
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 960 of file Maintenance.php.
References $args, $self, and(), loadSpecialVars(), and loadWithArgv().
Referenced by ClearUserWatchlistJobTest\runJobs(), CategoryMembershipChangeJobTest\runJobs(), setup(), ApiDeleteTest\testBatchedDelete(), WikiPageDbTestBase\testDoDeleteArticle(), WikiPageDbTestBase\testDoDeleteUpdates(), TemplateCategoriesTest\testTemplateCategories(), and WatchedItemStoreIntegrationTest\testUpdateResetAndSetNotificationTimestamp().
Maintenance::loadSettings | ( | ) |
Generic setup for most installs.
Returns the location of LocalSettings
Definition at line 1251 of file Maintenance.php.
References $IP, $wgCommandLineMode, and(), and fatalError().
|
protected |
Handle the special variables that are global to all scripts.
Definition at line 1024 of file Maintenance.php.
References and(), 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 854 of file Maintenance.php.
References $args, $options, and(), error, loadSpecialVars(), maybeHelp(), and setParam().
Referenced by DumpBackup\__construct(), TextPassDumper\__construct(), BackupDumper\__construct(), and loadParamsAndArgs().
|
private |
Lock the search index.
IMaintainableDatabase | &$db |
Definition at line 1442 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 1043 of file Maintenance.php.
References $mDependantParameters, $mGenericParameters, $mParams, $output, and(), hasOption(), output(), and script().
Referenced by CreateAndPromote\execute(), GenerateJsonI18n\execute(), JSParseHelper\execute(), PurgeChangedFiles\execute(), PurgeChangedPages\execute(), UserOptionsMaintenance\execute(), BackupReader\importFromStdin(), loadWithArgv(), setParam(), 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 791 of file Maintenance.php.
References and(), and 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 434 of file Maintenance.php.
References $out, and(), cleanupChanneled(), getConfig(), outputChanneled(), and print.
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(), CleanupUsersWithNoId\cleanup(), CleanupSpam\cleanupArticle(), Cleanup\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(), FixDefaultJsonContentPages\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), MigrateActors\doDBUpdates(), MigrateArchiveText\doDBUpdates(), MigrateImageCommentTemp\doDBUpdates(), PopulateArchiveRevId\doDBUpdates(), PopulateBacklinkNamespace\doDBUpdates(), PopulateExternallinksIndex60\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateImageSha1\doDBUpdates(), PopulateIpChanges\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulatePPSortKey\doDBUpdates(), PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), RefreshExternallinksIndex\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(), CountFancyCaptchas\execute(), DeleteOldFancyCaptchas\execute(), GenerateFancyCaptchas\execute(), Update\execute(), DisableOATHAuthForUser\execute(), UpdateScratchTokenFormat\execute(), CleanupArchiveUserText\execute(), RenameUserCleanup\execute(), Cleanup\execute(), UpdateCSS\execute(), UpdateLexerList\execute(), AddChangeTag\execute(), AttachLatest\execute(), BenchmarkPurge\execute(), ChangePassword\execute(), CheckBadRedirects\execute(), CheckComposerLockUpToDate\execute(), CheckImages\execute(), CheckUsernames\execute(), CleanupAncientTables\execute(), CleanupBlocks\execute(), CleanupCaps\execute(), CleanupPreferences\execute(), CleanupRemovedModules\execute(), CleanupSpam\execute(), TableCleanup\execute(), CleanupUploadStash\execute(), CleanupWatchlist\execute(), ClearInterwikiCache\execute(), CompareParserCache\execute(), ConvertExtensionToRegistration\execute(), ConvertLinks\execute(), ConvertUserOptions\execute(), CopyFileBackend\execute(), CopyJobQueue\execute(), CreateAndPromote\execute(), CreateCommonPasswordCdb\execute(), DeleteArchivedFiles\execute(), DeleteArchivedRevisions\execute(), DeleteAutoPatrolLogs\execute(), DeleteBatch\execute(), DeleteDefaultMessages\execute(), DeleteEqualMessages\execute(), DeleteOldRevisions\execute(), DeleteOrphanedRevisions\execute(), DeleteSelfExternals\execute(), DumpLinks\execute(), EditCLI\execute(), EmptyUserGroup\execute(), EraseArchivedFile\execute(), ExportSites\execute(), FetchText\execute(), FindHooks\execute(), FindMissingFiles\execute(), FindOrphanedFiles\execute(), FixDoubleRedirects\execute(), FixTimestamps\execute(), FixUserRegistration\execute(), GenerateJsonI18n\execute(), GetConfiguration\execute(), GetLagTimes\execute(), GetReplicaServer\execute(), GetTextMaint\execute(), BackupReader\execute(), ImportImages\execute(), ImportSites\execute(), ImportSiteScripts\execute(), ImportTextFiles\execute(), DeleteLocalPasswords\execute(), InitEditCount\execute(), InitSiteStats\execute(), InitUserPreference\execute(), InvalidateUserSesssions\execute(), JSParseHelper\execute(), DatabaseLag\execute(), AllTrans\execute(), DateFormats\execute(), Digit2Html\execute(), DumpMessages\execute(), LangMemUsage\execute(), LoggedUpdateMaintenance\execute(), MakeTestEdits\execute(), ManageForeignResources\execute(), McTest\execute(), MigrateFileRepoLayout\execute(), MigrateUserGroup\execute(), MoveBatch\execute(), MWDocGen\execute(), NamespaceDupes\execute(), NukeNS\execute(), NukePage\execute(), AlterSharedConstraints\execute(), PageExists\execute(), PatchSql\execute(), PopulateCategory\execute(), Protect\execute(), PruneFileCache\execute(), PurgeChangedPages\execute(), PurgeExpiredUserrights\execute(), PurgeList\execute(), PurgeModuleDeps\execute(), PurgeParserCache\execute(), ReassignEdits\execute(), RebuildAll\execute(), RebuildFileCache\execute(), RebuildLocalisationCache\execute(), RebuildMessages\execute(), RebuildRecentchanges\execute(), RebuildTextIndex\execute(), RecountCategories\execute(), RefreshFileHeaders\execute(), RefreshImageMetadata\execute(), RemoveInvalidEmails\execute(), RemoveUnusedAccounts\execute(), RenameDbPrefix\execute(), ResetPageRandom\execute(), ResetUserEmail\execute(), ResetUserTokens\execute(), RollbackEdits\execute(), RunBatchedQuery\execute(), RunJobs\execute(), ShowJobs\execute(), ShowSiteStats\execute(), CompressOld\execute(), DumpRev\execute(), OrphanStats\execute(), SyncFileBackend\execute(), TidyUpT39714\execute(), Undelete\execute(), UpdateMediaWiki\execute(), UpdateArticleCount\execute(), UpdateCollation\execute(), UpdateDoubleWidthSearch\execute(), UpdateExtensionJsonSchema\execute(), UpdateRestrictions\execute(), UpdateSpecialPages\execute(), ValidateRegistrationFile\execute(), ViewCLI\execute(), WrapOldPasswords\execute(), DeleteEqualMessages\fetchMessageInfo(), ImportSiteScripts\fetchScriptList(), GetConfiguration\formatVarDump(), DeleteLocalPasswords\getUserBatches(), ConvertExtensionToRegistration\handleExtensionMessagesFiles(), ConvertExtensionToRegistration\handleHooks(), DumpIterator\handleRevision(), DumpRenderer\handleRevision(), FixDefaultJsonContentPages\handleRow(), MWDocGen\init(), SqliteMaintenance\integrityCheck(), CleanupImages\killRow(), UserOptionsMaintenance\listAvailableOptions(), ReplaceAll\listTitles(), Update\logInfo(), GenerateSitemap\main(), maybeHelp(), MigrateComments\migrate(), MigrateActors\migrate(), MigrateActors\migrateLogSearch(), MigrateActors\migrateToTemp(), MigrateComments\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(), CleanupImages\processRow(), TitleCleanup\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(), 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 511 of file Maintenance.php.
References cleanupChanneled(), and print.
|
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 1569 of file Maintenance.php.
References and(), and posix_isatty().
Referenced by FindDeprecated\execute(), MwSql\execute(), ParserTestsMaintenance\execute(), posix_isatty(), 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 1288 of file Maintenance.php.
References $res, $wgMultiContentRevisionSchemaMigrationStage, and(), beginTransaction(), commitTransaction(), DB_MASTER, getDB(), output(), and SCHEMA_COMPAT_READ_OLD.
Referenced by DeleteOldRevisions\doDelete(), DeleteArchivedRevisions\execute(), DeleteOrphanedRevisions\execute(), NukeNS\execute(), NukePage\execute(), and PurgeOldText\execute().
|
static |
Prompt the console for input.
string | $prompt | What to begin the line with, like '> ' |
Definition at line 1582 of file Maintenance.php.
References and(), 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 1614 of file Maintenance.php.
References $command, $line, and(), print, and wfIsWindows().
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 1469 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 619 of file Maintenance.php.
References $name.
Referenced by CountFancyCaptchas\__construct(), DeleteOldFancyCaptchas\__construct(), GenerateFancyCaptchas\__construct(), Update\__construct(), DisableOATHAuthForUser\__construct(), UpdateScratchTokenFormat\__construct(), CleanupArchiveUserText\__construct(), RenameUserCleanup\__construct(), ReplaceAll\__construct(), Cleanup\__construct(), UpdateCSS\__construct(), and UpdateLexerList\__construct().
|
static |
Call this to set up the autoloader to allow classes to be used from the tests directory.
Definition at line 1681 of file Maintenance.php.
Referenced by CheckLess\execute(), ParserEditTests\finalSetup(), ParserFuzzTest\finalSetup(), ParserTestsMaintenance\finalSetup(), and PHPUnitMaintClass\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 1434 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 708 of file Maintenance.php.
References $maintClass, and(), and error.
Referenced by NukeNS\execute(), RebuildAll\execute(), and UpdateMediaWiki\execute().
Maintenance::setAgentAndTriggers | ( | ) |
Set triggers like when to try to run deferred updates.
Definition at line 649 of file Maintenance.php.
References and(), 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 321 of file Maintenance.php.
References and().
Referenced by CommandLineInc\__construct(), and PHPUnitMaintClass\__construct().
|
protected |
Set the batch size.
int | $s | The number of operations to do in a batch |
Definition at line 375 of file Maintenance.php.
References $s, addOption(), and and().
Referenced by RenameUserCleanup\__construct(), CategoryChangesAsRdf\__construct(), CheckImages\__construct(), CheckUsernames\__construct(), CleanupBlocks\__construct(), CleanupInvalidDbKeys\__construct(), CleanupPreferences\__construct(), CleanupRemovedModules\__construct(), CleanupUploadStash\__construct(), CleanupUsersWithNoId\__construct(), ConvertUserOptions\__construct(), CopyFileBackend\__construct(), CopyJobQueue\__construct(), DeduplicateArchiveRevId\__construct(), DeleteAutoPatrolLogs\__construct(), DeleteSelfExternals\__construct(), DumpCategoriesAsRdf\__construct(), FindMissingFiles\__construct(), FindOrphanedFiles\__construct(), FixDefaultJsonContentPages\__construct(), FixUserRegistration\__construct(), DeleteLocalPasswords\__construct(), MigrateActors\__construct(), InitUserPreference\__construct(), InvalidateUserSesssions\__construct(), LoggedUpdateMaintenance\__construct(), MakeTestEdits\__construct(), MigrateComments\__construct(), MigrateFileRepoLayout\__construct(), MigrateUserGroup\__construct(), PopulateArchiveRevId\__construct(), PopulateChangeTagDef\__construct(), PopulateContentModel\__construct(), PopulateContentTables\__construct(), PopulateExternallinksIndex60\__construct(), PopulateLogSearch\__construct(), PopulateLogUsertext\__construct(), PopulatePPSortKey\__construct(), PopulateRecentChangesSource\__construct(), PopulateRevisionLength\__construct(), PopulateRevisionSha1\__construct(), PurgeChangedFiles\__construct(), PurgeChangedPages\__construct(), PurgeList\__construct(), PurgeModuleDeps\__construct(), RebuildFileCache\__construct(), RebuildRecentchanges\__construct(), RecountCategories\__construct(), RefreshExternallinksIndex\__construct(), RefreshFileHeaders\__construct(), RefreshImageMetadata\__construct(), RefreshLinks\__construct(), RemoveInvalidEmails\__construct(), ResetPageRandom\__construct(), ResetUserTokens\__construct(), SyncFileBackend\__construct(), UpdateRestrictions\__construct(), WrapOldPasswords\__construct(), PopulateChangeTagDef\doDBUpdates(), CopyFileBackend\execute(), and DeleteAutoPatrolLogs\execute().
Maintenance::setConfig | ( | Config | $config | ) |
Config | $config |
Definition at line 606 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 1385 of file Maintenance.php.
Referenced by DatabaseUpdater\__construct().
LBFactory | $LBFactory | |
Config | $config |
Definition at line 670 of file Maintenance.php.
References $config, $services, Config\get(), 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 930 of file Maintenance.php.
References $options, $value, and(), error, and maybeHelp().
Referenced by loadWithArgv().
Maintenance::setup | ( | ) |
Do some sanity checking and basic setup.
Definition at line 734 of file Maintenance.php.
References $IP, $wgCommandLineMode, adjustMemoryLimit(), and(), fatalError(), and loadParamsAndArgs().
|
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 191 of file Maintenance.php.
References $wgCommandLineMode, and and().
|
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 233 of file Maintenance.php.
References and().
Referenced by validateParamsAndArgs().
|
private |
Unlock the tables.
IMaintainableDatabase | &$db |
Definition at line 1460 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 1481 of file Maintenance.php.
References and(), 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 1518 of file Maintenance.php.
References $rev, $title, Revision\loadFromPageId(), and output().
Referenced by UpdateDoubleWidthSearch\searchIndexUpdateCallback(), and UpdateSearchIndex\searchIndexUpdateCallback().
Maintenance::validateParamsAndArgs | ( | ) |
Run some validation checks on the params, etc.
Reimplemented in GetConfiguration, CommandLineInstaller, and UpdateMediaWiki.
Definition at line 992 of file Maintenance.php.
References $opt, error, hasArg(), hasOption(), maybeHelp(), and supportsOption().
|
private |
Definition at line 490 of file Maintenance.php.
|
private |
Accessible via getConfig()
Definition at line 148 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 141 of file Maintenance.php.
|
private |
Definition at line 491 of file Maintenance.php.
|
private |
UNIX timestamp.
Definition at line 135 of file Maintenance.php.
|
protected |
Definition at line 100 of file Maintenance.php.
|
protected |
Definition at line 91 of file Maintenance.php.
|
protected |
Definition at line 97 of file Maintenance.php.
Referenced by CommandLineInc\execute(), and JSParseHelper\execute().
|
protected |
Batch size.
If a script supports this, they should set a default with setBatchSize()
Definition at line 121 of file Maintenance.php.
Referenced by PopulateExternallinksIndex60\doDBUpdates(), and getBatchSize().
|
private |
|
protected |
Definition at line 107 of file Maintenance.php.
Referenced by finalSetup().
|
protected |
Definition at line 107 of file Maintenance.php.
Referenced by finalSetup().
|
private |
Definition at line 126 of file Maintenance.php.
Referenced by maybeHelp().
|
protected |
Definition at line 110 of file Maintenance.php.
|
private |
Definition at line 124 of file Maintenance.php.
Referenced by maybeHelp().
|
protected |
Definition at line 113 of file Maintenance.php.
|
protected |
Definition at line 94 of file Maintenance.php.
Referenced by CommandLineInc\execute().
|
protected |
Definition at line 85 of file Maintenance.php.
Referenced by addDefaultParams(), and maybeHelp().
|
protected |
Definition at line 106 of file Maintenance.php.
Referenced by isQuiet().
|
protected |
Definition at line 103 of file Maintenance.php.
Referenced by getName().
|
protected |
Definition at line 88 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 167 of file Maintenance.php.
Referenced by BackupDumper\processOptions().
|
private |
Definition at line 154 of file Maintenance.php.
const Maintenance::DB_ADMIN = 2 |
Definition at line 79 of file Maintenance.php.
Referenced by CleanupArchiveUserText\getDbType(), ConvertLinks\getDbType(), AlterSharedConstraints\getDbType(), PatchSql\getDbType(), RebuildAll\getDbType(), RebuildTextIndex\getDbType(), RenameDbPrefix\getDbType(), RunBatchedQuery\getDbType(), MwSql\getDbType(), UpdateMediaWiki\getDbType(), UpdateDoubleWidthSearch\getDbType(), UpdateSearchIndex\getDbType(), and PHPUnitMaintClass\getDbType().
const Maintenance::DB_NONE = 0 |
Constants for DB access type.
Definition at line 77 of file Maintenance.php.
Referenced by DumpIterator\finalSetup(), SearchDump\getDbType(), FindHooks\getDbType(), CommandLineInstaller\getDbType(), GenerateNormalizerDataAr\getDbType(), GenerateNormalizerDataMl\getDbType(), MWDocGen\getDbType(), PreprocessDump\getDbType(), SqliteMaintenance\getDbType(), and GenerateRandomImages\getDbType().
const Maintenance::DB_STD = 1 |
Definition at line 78 of file Maintenance.php.
Referenced by getDbType().
const Maintenance::STDIN_ALL = 'all' |
Definition at line 82 of file Maintenance.php.
Referenced by EditCLI\execute().