MediaWiki
1.23.10
|
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort. More...
Inherited by AllTrans, AlterSharedConstraints, AttachLatest, BackupReader, BatchedQueryRunner, Benchmarker, BenchmarkParse, ChangePassword, CheckBadRedirects, CheckImages, CheckLess, CheckUsernames, CleanupAncientTables, CleanupPreferences, CleanupRemovedModules, CleanupSpam, ClearCacheStats, ClearInterwikiCache, CLIParser, CommandLineInc, CommandLineInstaller, CompressOld, ConvertLinks, ConvertUserOptions, CopyFileBackend, CopyJobQueue, CountMessages, CreateAndPromote, DatabaseLag, DateFormats, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteBatch, DeleteDefaultMessages, DeleteEqualMessages, DeleteImageCache, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteRevision, DeleteSelfExternals, Digit2Html, DumpIterator, DumpLinks, DumpMessages, DumpRenderer, DumpRev, DumpSisterSites, EditCLI, EraseArchivedFile, FakeMaintenance, FetchText, FindHooks, FixBug20757, FixDoubleRedirects, FixSlaveDesync, FixTimestamps, FixUserRegistration, GenerateCollationData, GenerateJqueryMsgData, GenerateJsonI18n, GenerateNormalizerDataAr, GenerateNormalizerDataMl, GenerateRandomImages, GenerateUtf8Case, GetConfiguration, GetLagTimes, GetSlaveServer, GetTextMaint, ImageBuilder, ImportSiteScripts, InitEditCount, InitSiteStats, JSParseHelper, LangMemUsage, LoggedUpdateMaintenance, MaintenanceFixup, MaintenanceFormatInstallDoc, McTest, MergeMessageFileList, MigrateUserGroup, MinifyScript, MoveBatch, MWDocGen, MwSql, NamespaceConflictChecker, NextJobDB, NukeNS, NukePage, Orphans, OrphanStats, PatchSql, PHPUnitMaintClass, PopulateCategory, Protect, PruneFileCache, PurgeChangedFiles, PurgeChangedPages, PurgeList, PurgeOldText, PurgeParserCache, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RefreshFileHeaders, RefreshImageMetadata, RefreshLinks, RemoveUnusedAccounts, RenameDbPrefix, ResetUserTokens, RollbackEdits, RunJobs, ShowCacheStats, ShowJobs, ShowSiteStats, SqliteMaintenance, StorageTypeStats, SyncFileBackend, TableCleanup, TestFileOpPerformance, TidyUpBug37714, Undelete, UpdateArticleCount, UpdateCollation, UpdateDoubleWidthSearch, UpdateMediaWiki, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, UploadDumper, UploadStashCleanup, and WaitForSlave.
Public Member Functions | |
__construct () | |
Default constructor. 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... | |
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... | |
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... | |
setDB (&$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 | 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 | 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 | |
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 | |
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) | |
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... | |
deleteOption ( $name) | |
Remove an option. More... | |
error ( $err, $die=0) | |
Throw an error to the user. More... | |
getArg ( $argId=0, $default=null) | |
Get an argument. More... | |
& | getDB ( $db, $groups=array(), $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 param 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... | |
setBatchSize ( $s=0) | |
Set the batch size. More... | |
validateParamsAndArgs () | |
Run some validation checks on the params, etc. More... | |
Protected Attributes | |
$mArgList = array() | |
$mArgs = array() | |
int | $mBatchSize = null |
Batch size. More... | |
$mDbUser | |
$mDescription = '' | |
$mInputLoaded = false | |
$mOptions = array() | |
$mParams = array() | |
$mQuiet = false | |
$mSelf | |
$mShortParamsMap = array() | |
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... | |
unlockSearchindex (&$db) | |
Unlock the tables. More... | |
Static Private Member Functions | |
static | readlineEmulation ( $prompt) |
Emulate readline() More... | |
Private Attributes | |
$atLineStart = true | |
$lastChannel = null | |
DatabaseBase | $mDb = null |
Used by getDD() / setDB() More... | |
$mDependantParameters = array() | |
$mGenericParameters = array() | |
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, GenerateJqueryMsgData, CLIParser, PurgeChangedFiles, CompressOld, GenerateCollationData, FindHooks, GetConfiguration, ImageCleanup, WatchlistCleanup, MWDocGen, PreprocessDump, TableCleanup, MoveBatch, ImageBuilder, NukeNS, DumpRenderer, bench_strtr_str_replace, CompareParsers, BackupReader, MergeMessageFileList, RefreshImageMetadata, UpdateCollation, Digit2Html, RebuildTextIndex, UpdateMediaWiki, DumpIterator, DumpLinks, NamespaceConflictChecker, Benchmarker, CapsCleanup, TitleCleanup, CopyFileBackend, DeleteBatch, CommandLineInstaller, Orphans, RebuildLocalisationCache, ShowSiteStats, UpdateSearchIndex, BenchmarkParse, UploadStashCleanup, GenerateUtf8Case, PurgeChangedPages, AttachLatest, ConvertLinks, CreateAndPromote, DeleteArchivedRevisions, FixTimestamps, ShowJobs, FixBug20757, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CheckUsernames, DeleteArchivedFiles, DumpSisterSites, EraseArchivedFile, FixDoubleRedirects, GenerateJsonI18n, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, UpdateArticleCount, UpdateRestrictions, ChangePassword, CleanupRemovedModules, ConvertUserOptions, CopyJobQueue, DeleteImageCache, DeleteOrphanedRevisions, FixExtLinksProtocolRelative, DateFormats, LangMemUsage, PopulateParentId, PruneFileCache, PurgeParserCache, ReassignEdits, RefreshFileHeaders, ResetUserTokens, UpdateDoubleWidthSearch, bench_wfBaseConvert, CleanupAncientTables, DeleteDefaultMessages, DeleteRevision, GetTextMaint, InitSiteStats, JSParseHelper, DumpMessages, McTest, MinifyScript, NukePage, PopulateRevisionLength, PopulateRevisionSha1, RebuildRecentchanges, RemoveUnusedAccounts, RenameDbPrefix, RollbackEdits, BatchedQueryRunner, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CleanupSpam, ClearCacheStats, ClearInterwikiCache, DeleteOldRevisions, DeleteSelfExternals, UploadDumper, FetchText, TestFileOpPerformance, FixSlaveDesync, FixUserRegistration, ImportSiteScripts, AllTrans, CountMessages, GenerateNormalizerDataAr, GenerateNormalizerDataMl, AlterSharedConstraints, PatchSql, PopulateFilearchiveSha1, PopulateRecentChangesSource, PurgeOldText, RebuildAll, ShowCacheStats, MwSql, DumpRev, OrphanStats, SyncFileBackend, UpdateSpecialPages, WaitForSlave, CheckBadRedirects, CheckImages, CheckLess, CommandLineInc, EditCLI, MaintenanceFormatInstallDoc, GetLagTimes, GetSlaveServer, DatabaseLag, MigrateUserGroup, NextJobDB, PopulateImageSha1, Protect, PurgeList, RebuildFileCache, RebuildMessages, RefreshLinks, RunJobs, SqliteMaintenance, DeleteEqualMessages, InitEditCount, Undelete, and PHPUnitMaintClass.
Definition at line 118 of file Maintenance.php.
References $IP, addDefaultParams(), array(), and global.
|
inlineprivate |
Definition at line 41 of file maintenance.txt.
|
protected |
Add some args that are needed.
$arg | String: name of the arg, like 'start' |
$description | String: short description of the arg |
$required | Boolean: is this required? |
Definition at line 207 of file Maintenance.php.
References array().
Referenced by Undelete\__construct(), MaintenanceFormatInstallDoc\__construct(), MigrateUserGroup\__construct(), Protect\__construct(), RefreshLinks\__construct(), EditCLI\__construct(), PatchSql\__construct(), DumpRev\__construct(), CleanupSpam\__construct(), ImportSiteScripts\__construct(), WaitForSlave\__construct(), NukePage\__construct(), GetTextMaint\__construct(), JSParseHelper\__construct(), McTest\__construct(), ReassignEdits\__construct(), GenerateJsonI18n\__construct(), CreateAndPromote\__construct(), ConvertLinks\__construct(), FixTimestamps\__construct(), BenchmarkParse\__construct(), DeleteBatch\__construct(), CommandLineInstaller\__construct(), BackupReader\__construct(), MoveBatch\__construct(), and CLIParser\__construct().
|
protected |
Add the default parameters to the scripts.
Definition at line 406 of file Maintenance.php.
References $mParams, addOption(), and getDbType().
Referenced by __construct().
|
protected |
Set the description text.
$text | String: the text of the description |
Definition at line 227 of file Maintenance.php.
Referenced by PurgeParserCache\__construct(), and BenchmarkParse\__construct().
|
protected |
Add a parameter to the script.
Will be displayed on –help with the associated description
$name | String: the name of the param (help, version, etc) |
$description | String: the description of the param to show on –help |
$required | Boolean: is the param required? |
$withArg | Boolean: is an argument required with this option? |
$shortName | String: character to use as short name |
Definition at line 169 of file Maintenance.php.
References $name, and array().
Referenced by PHPUnitMaintClass\__construct(), Undelete\__construct(), InitEditCount\__construct(), DeleteEqualMessages\__construct(), CommandLineInc\__construct(), GetSlaveServer\__construct(), PurgeList\__construct(), RebuildFileCache\__construct(), MaintenanceFormatInstallDoc\__construct(), RefreshLinks\__construct(), RunJobs\__construct(), SqliteMaintenance\__construct(), DatabaseLag\__construct(), EditCLI\__construct(), NextJobDB\__construct(), PopulateImageSha1\__construct(), Protect\__construct(), PurgeOldText\__construct(), ImportSiteScripts\__construct(), DeleteOldRevisions\__construct(), MwSql\__construct(), GenerateNormalizerDataAr\__construct(), SyncFileBackend\__construct(), UpdateSpecialPages\__construct(), CleanupSpam\__construct(), UploadDumper\__construct(), TestFileOpPerformance\__construct(), bench_wfBaseConvert\__construct(), RemoveUnusedAccounts\__construct(), GetTextMaint\__construct(), RenameDbPrefix\__construct(), RollbackEdits\__construct(), InitSiteStats\__construct(), McTest\__construct(), MinifyScript\__construct(), CleanupAncientTables\__construct(), NukePage\__construct(), PruneFileCache\__construct(), ChangePassword\__construct(), PurgeParserCache\__construct(), ReassignEdits\__construct(), CleanupRemovedModules\__construct(), RefreshFileHeaders\__construct(), DeleteImageCache\__construct(), UpdateDoubleWidthSearch\__construct(), DeleteOrphanedRevisions\__construct(), ResetUserTokens\__construct(), CopyJobQueue\__construct(), DeleteArchivedFiles\__construct(), GenerateJsonI18n\__construct(), UpdateArticleCount\__construct(), EraseArchivedFile\__construct(), FixDoubleRedirects\__construct(), PopulateCategory\__construct(), DeleteArchivedRevisions\__construct(), CreateAndPromote\__construct(), ShowJobs\__construct(), AttachLatest\__construct(), FixBug20757\__construct(), BenchmarkParse\__construct(), GenerateUtf8Case\__construct(), PurgeChangedPages\__construct(), UpdateSearchIndex\__construct(), DeleteBatch\__construct(), CommandLineInstaller\__construct(), Benchmarker\__construct(), RebuildLocalisationCache\__construct(), CopyFileBackend\__construct(), Orphans\__construct(), CapsCleanup\__construct(), DumpIterator\__construct(), NamespaceConflictChecker\__construct(), UpdateMediaWiki\__construct(), BackupReader\__construct(), UpdateCollation\__construct(), RefreshImageMetadata\__construct(), CompareParsers\__construct(), MergeMessageFileList\__construct(), DumpRenderer\__construct(), NukeNS\__construct(), MoveBatch\__construct(), ImageBuilder\__construct(), TableCleanup\__construct(), MWDocGen\__construct(), PreprocessDump\__construct(), WatchlistCleanup\__construct(), FindHooks\__construct(), GetConfiguration\__construct(), GenerateCollationData\__construct(), CompressOld\__construct(), PurgeChangedFiles\__construct(), CLIParser\__construct(), SearchDump\__construct(), LoggedUpdateMaintenance\__construct(), addDefaultParams(), and setBatchSize().
|
protected |
Adjusts PHP's memory limit to better suit our needs, if needed.
Definition at line 539 of file Maintenance.php.
References $limit, and memoryLimit().
Referenced by finalSetup(), and setup().
|
protected |
Execute a callback function at the end of initialisation.
Reimplemented in UpdateMediaWiki.
Definition at line 890 of file Maintenance.php.
Referenced by finalSetup().
Maintenance::cleanupChanneled | ( | ) |
Clean up channeled output.
Output a newline if necessary.
Definition at line 352 of file Maintenance.php.
Referenced by output(), and outputChanneled().
Maintenance::clearParamsAndArgs | ( | ) |
|
protected |
Remove an option.
Useful for removing options that won't be used in your script.
$name | String: the option to remove. |
Definition at line 219 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
$err | String: the error to display |
$die | Int: if > 0, go ahead and die out using this int as the code |
Definition at line 333 of file Maintenance.php.
References outputChanneled().
Referenced by SqliteMaintenance\backup(), ImageCleanup\buildSafeTitle(), CompareParsers\checkOptions(), SqliteMaintenance\checkSyntax(), CleanupSpam\cleanupArticle(), UpdateMediaWiki\compatChecks(), CompressOld\compressPage(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), CopyFileBackend\delFileBatch(), PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateImageSha1\doDBUpdates(), UploadStashCleanup\doOperations(), UpdateSpecialPages\doSpecialPageCacheUpdates(), Undelete\execute(), GetLagTimes\execute(), BenchmarkPurge\execute(), DumpRev\execute(), MaintenanceFormatInstallDoc\execute(), DeleteRevision\execute(), CleanupAncientTables\execute(), BatchedQueryRunner\execute(), DeleteDefaultMessages\execute(), MigrateUserGroup\execute(), CleanupSpam\execute(), GetTextMaint\execute(), RemoveUnusedAccounts\execute(), ImportSiteScripts\execute(), MwSql\execute(), LangMemUsage\execute(), PruneFileCache\execute(), CheckUsernames\execute(), ShowCacheStats\execute(), UpdateSpecialPages\execute(), UpdateRestrictions\execute(), PatchSql\execute(), Protect\execute(), RollbackEdits\execute(), ChangePassword\execute(), OrphanStats\execute(), McTest\execute(), FixDoubleRedirects\execute(), CopyJobQueue\execute(), RenameDbPrefix\execute(), GenerateNormalizerDataAr\execute(), UploadStashCleanup\execute(), EraseArchivedFile\execute(), FixTimestamps\execute(), ReassignEdits\execute(), PurgeParserCache\execute(), UpdateDoubleWidthSearch\execute(), EditCLI\execute(), CapsCleanup\execute(), GenerateJsonI18n\execute(), Digit2Html\execute(), SyncFileBackend\execute(), CreateAndPromote\execute(), DumpIterator\execute(), RunJobs\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), DeleteBatch\execute(), GenerateUtf8Case\execute(), SqliteMaintenance\execute(), RebuildTextIndex\execute(), BenchmarkParse\execute(), DumpRenderer\execute(), MergeMessageFileList\execute(), ConvertLinks\execute(), UpdateSearchIndex\execute(), MinifyScript\execute(), MoveBatch\execute(), CopyFileBackend\execute(), RefreshImageMetadata\execute(), GenerateCollationData\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), CompressOld\execute(), CommandLineInstaller\execute(), PurgeChangedFiles\execute(), BackupReader\execute(), UpdateMediaWiki\execute(), DeleteEqualMessages\execute(), MWDocGen\execute(), GenerateCollationData\generateFirstChars(), MinifyScript\getExtension(), CopyFileBackend\getListingDiffRel(), BackupReader\getNsIndex(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), ReassignEdits\initialiseUser(), SqliteMaintenance\integrityCheck(), loadParamsAndArgs(), loadSettings(), MinifyScript\minify(), TitleCleanup\moveInconsistentPage(), ImageCleanup\pokeFile(), PreprocessDump\processRevision(), CompareParsers\processRevision(), PurgeChangedFiles\purgeFromArchiveTable(), PurgeChangedFiles\purgeFromLogType(), MergeMessageFileList\readFile(), runChild(), setup(), RefreshImageMetadata\setupParameters(), GenerateJsonI18n\shimOnly(), BackupReader\skippedNamespace(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), RefreshFileHeaders\updateFileHeaders(), SqliteMaintenance\vacuum(), GetConfiguration\validateParamsAndArgs(), validateParamsAndArgs(), and CLIParser\Wikitext().
|
inlineprivate |
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, MaintenanceFixup, GetConfiguration, MWDocGen, DeleteEqualMessages, GenerateJqueryMsgData, UpdateMediaWiki, BackupReader, PurgeChangedFiles, CommandLineInstaller, CompressOld, UpdateCollation, CLIParser, RebuildLocalisationCache, GenerateCollationData, PHPUnitMaintClass, FindHooks, PopulateCategory, RefreshImageMetadata, ImageBuilder, CopyFileBackend, MoveBatch, MinifyScript, WatchlistCleanup, ConvertLinks, NukeNS, UpdateSearchIndex, BenchmarkParse, MergeMessageFileList, DumpRenderer, TableCleanup, NamespaceConflictChecker, RebuildTextIndex, SqliteMaintenance, CommandLineInc, DeleteBatch, GenerateUtf8Case, PurgeChangedPages, RebuildFileCache, RunJobs, DumpIterator, Orphans, PopulateImageSha1, bench_strtr_str_replace, CreateAndPromote, FetchText, SyncFileBackend, DeleteArchivedFiles, DeleteArchivedRevisions, GenerateJsonI18n, Digit2Html, CapsCleanup, DumpLinks, EditCLI, PurgeParserCache, UpdateDoubleWidthSearch, AttachLatest, FixTimestamps, ReassignEdits, RefreshLinks, UploadStashCleanup, CopyJobQueue, EraseArchivedFile, TestFileOpPerformance, FixDoubleRedirects, GenerateNormalizerDataAr, RefreshFileHeaders, RenameDbPrefix, ShowJobs, ShowSiteStats, FixBug20757, ChangePassword, UploadDumper, InitSiteStats, McTest, PatchSql, Protect, PurgeList, ResetUserTokens, RollbackEdits, OrphanStats, bench_wfBaseConvert, CheckUsernames, CleanupRemovedModules, DeleteImageCache, FixSlaveDesync, GenerateNormalizerDataMl, AlterSharedConstraints, PruneFileCache, RebuildAll, ShowCacheStats, UpdateArticleCount, UpdateRestrictions, UpdateSpecialPages, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CleanupSpam, ConvertUserOptions, DeleteOrphanedRevisions, DumpSisterSites, GetTextMaint, ImportSiteScripts, InitEditCount, LangMemUsage, NukePage, RemoveUnusedAccounts, MwSql, CleanupAncientTables, DeleteDefaultMessages, DeleteOldRevisions, JSParseHelper, DateFormats, MigrateUserGroup, BatchedQueryRunner, DeleteRevision, DeleteSelfExternals, MaintenanceFormatInstallDoc, DumpMessages, NextJobDB, PurgeOldText, RebuildRecentchanges, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CheckImages, ClearCacheStats, ClearInterwikiCache, FixUserRegistration, DatabaseLag, AllTrans, CountMessages, DumpRev, CheckBadRedirects, CheckLess, GetLagTimes, GetSlaveServer, RebuildMessages, WaitForSlave, Undelete, CleanupPreferences, StorageTypeStats, GenerateRandomImages, and TidyUpBug37714.
Maintenance::finalSetup | ( | ) |
Handle some last-minute setup here.
Reimplemented in DumpIterator, GetConfiguration, RebuildLocalisationCache, RebuildFileCache, and PHPUnitMaintClass.
Definition at line 825 of file Maintenance.php.
References $mDbPass, $mDbUser, $wgCommandLineMode, adjustMemoryLimit(), afterFinalSetup(), array(), as, LBFactory\destroyInstance(), getDbType(), getOption(), global, hasOption(), Profiler\instance(), and Profiler\setInstance().
|
protected |
Get an argument.
$argId | Integer: the integer value (from zero) for the arg |
$default | Mixed: the default if it doesn't exist |
Definition at line 246 of file Maintenance.php.
References hasArg().
Referenced by Undelete\execute(), WaitForSlave\execute(), CountMessages\execute(), DumpRev\execute(), MaintenanceFormatInstallDoc\execute(), MigrateUserGroup\execute(), BatchedQueryRunner\execute(), CleanupSpam\execute(), GetTextMaint\execute(), NukePage\execute(), MwSql\execute(), ImportSiteScripts\execute(), FixSlaveDesync\execute(), McTest\execute(), Protect\execute(), RefreshLinks\execute(), FixTimestamps\execute(), ReassignEdits\execute(), EditCLI\execute(), GenerateJsonI18n\execute(), CreateAndPromote\execute(), DeleteBatch\execute(), BenchmarkParse\execute(), ConvertLinks\execute(), MinifyScript\execute(), MoveBatch\execute(), BackupReader\execute(), ImportSiteScripts\fetchScriptList(), and CLIParser\Wikitext().
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()
Reimplemented in OrphanStats.
Definition at line 1007 of file Maintenance.php.
References $mDb, and wfGetDB().
Referenced by PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateRevisionLength\doLenUpdates(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), PurgeChangedPages\execute(), UpdateCollation\execute(), PurgeChangedFiles\execute(), LoggedUpdateMaintenance\execute(), PurgeChangedFiles\purgeFromLogType(), purgeRedundantText(), 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 SearchDump, MwSql, PHPUnitMaintClass, MWDocGen, BatchedQueryRunner, FindHooks, UpdateMediaWiki, PreprocessDump, ConvertLinks, UpdateSearchIndex, RebuildTextIndex, SqliteMaintenance, GenerateUtf8Case, UpdateDoubleWidthSearch, GenerateNormalizerDataAr, RenameDbPrefix, PatchSql, FixSlaveDesync, GenerateNormalizerDataMl, AlterSharedConstraints, RebuildAll, ShowCacheStats, and GenerateRandomImages.
Definition at line 399 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 276 of file Maintenance.php.
References $mSelf.
|
protected |
Get an option, or return the default.
$name | String: the name of the param |
$default | Mixed: anything you want, default null |
Definition at line 191 of file Maintenance.php.
References $name, and hasOption().
Referenced by Benchmarker\bench(), CompareParsers\checkOptions(), PreprocessDump\checkOptions(), SqliteMaintenance\checkSyntax(), PopulateImageSha1\doDBUpdates(), TestFileOpPerformance\doPerfTest(), PurgeList\doPurge(), UpdateSpecialPages\doSpecialPageCacheUpdates(), Undelete\execute(), GetSlaveServer\execute(), BenchmarkPurge\execute(), MaintenanceFormatInstallDoc\execute(), NextJobDB\execute(), RemoveUnusedAccounts\execute(), MwSql\execute(), NukePage\execute(), ImportSiteScripts\execute(), bench_wfBaseConvert\execute(), UpdateSpecialPages\execute(), PruneFileCache\execute(), DeleteImageCache\execute(), CleanupRemovedModules\execute(), UploadDumper\execute(), ResetUserTokens\execute(), McTest\execute(), RollbackEdits\execute(), ChangePassword\execute(), Protect\execute(), PurgeList\execute(), GenerateNormalizerDataAr\execute(), RefreshFileHeaders\execute(), RenameDbPrefix\execute(), EraseArchivedFile\execute(), FixBug20757\execute(), FixDoubleRedirects\execute(), CopyJobQueue\execute(), TestFileOpPerformance\execute(), RefreshLinks\execute(), EditCLI\execute(), UpdateDoubleWidthSearch\execute(), CapsCleanup\execute(), PurgeParserCache\execute(), GenerateJsonI18n\execute(), SyncFileBackend\execute(), PopulateImageSha1\execute(), DumpIterator\execute(), GenerateUtf8Case\execute(), RunJobs\execute(), DeleteBatch\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), SqliteMaintenance\execute(), NamespaceConflictChecker\execute(), DumpRenderer\execute(), MergeMessageFileList\execute(), BenchmarkParse\execute(), NukeNS\execute(), UpdateSearchIndex\execute(), MinifyScript\execute(), MoveBatch\execute(), CopyFileBackend\execute(), RefreshImageMetadata\execute(), PopulateCategory\execute(), PHPUnitMaintClass\execute(), GenerateCollationData\execute(), RebuildLocalisationCache\execute(), CompressOld\execute(), UpdateCollation\execute(), CommandLineInstaller\execute(), BackupReader\execute(), PurgeChangedFiles\execute(), UpdateMediaWiki\execute(), DeleteEqualMessages\execute(), GetConfiguration\execute(), GetConfiguration\finalSetup(), finalSetup(), RefreshImageMetadata\getConditions(), CLIParser\getTitle(), MWDocGen\init(), loadSpecialVars(), memoryLimit(), MinifyScript\minify(), CompareParsers\processRevision(), SearchDump\processRevision(), PurgeChangedFiles\purgeFromLogType(), PurgeList\sendPurgeRequest(), SyncFileBackend\syncFileBatch(), and GetConfiguration\validateParamsAndArgs().
|
protected |
Return input from stdin.
$len | Integer: the number of bytes to read. If null, just return the handle. Maintenance::STDIN_ALL returns the full length |
Reimplemented in SemiMockedFetchText.
Definition at line 287 of file Maintenance.php.
Referenced by PurgeList\doPurge(), EditCLI\execute(), FetchText\execute(), DumpIterator\execute(), DeleteBatch\execute(), DumpRenderer\execute(), and MoveBatch\execute().
Maintenance::globals | ( | ) |
Potentially debug globals.
Originally a feature only for refreshLinks
Definition at line 900 of file Maintenance.php.
References $GLOBALS, and hasOption().
|
protected |
Does a given argument exist?
$argId | Integer: the integer value (from zero) for the arg |
Definition at line 236 of file Maintenance.php.
Referenced by MaintenanceFormatInstallDoc\execute(), JSParseHelper\execute(), BatchedQueryRunner\execute(), MwSql\execute(), FixSlaveDesync\execute(), McTest\execute(), ReassignEdits\execute(), DeleteBatch\execute(), MoveBatch\execute(), BackupReader\execute(), getArg(), and validateParamsAndArgs().
|
protected |
Checks to see if a particular param exists.
$name | String: the name of the param |
Definition at line 181 of file Maintenance.php.
References $name.
Referenced by CompareParsers\checkOptions(), PreprocessDump\checkOptions(), CleanupSpam\cleanupArticle(), CopyFileBackend\copyFileBatch(), ConvertLinks\createTempTable(), TestFileOpPerformance\doPerfTest(), UpdateSpecialPages\doSpecialPageCacheUpdates(), GetSlaveServer\execute(), BenchmarkPurge\execute(), DatabaseLag\execute(), PurgeOldText\execute(), NextJobDB\execute(), MaintenanceFormatInstallDoc\execute(), CleanupAncientTables\execute(), DeleteOldRevisions\execute(), GetTextMaint\execute(), InitEditCount\execute(), RemoveUnusedAccounts\execute(), MwSql\execute(), DeleteOrphanedRevisions\execute(), CleanupSpam\execute(), UpdateArticleCount\execute(), UpdateSpecialPages\execute(), PurgeList\execute(), InitSiteStats\execute(), RollbackEdits\execute(), ChangePassword\execute(), UploadDumper\execute(), Protect\execute(), RefreshFileHeaders\execute(), ShowJobs\execute(), GenerateNormalizerDataAr\execute(), EraseArchivedFile\execute(), ReassignEdits\execute(), RefreshLinks\execute(), AttachLatest\execute(), CapsCleanup\execute(), EditCLI\execute(), GenerateJsonI18n\execute(), DeleteArchivedRevisions\execute(), DeleteArchivedFiles\execute(), CreateAndPromote\execute(), SyncFileBackend\execute(), DumpIterator\execute(), Orphans\execute(), GenerateUtf8Case\execute(), RunJobs\execute(), PurgeChangedPages\execute(), TableCleanup\execute(), SqliteMaintenance\execute(), NamespaceConflictChecker\execute(), BenchmarkParse\execute(), DumpRenderer\execute(), MergeMessageFileList\execute(), WatchlistCleanup\execute(), ConvertLinks\execute(), UpdateSearchIndex\execute(), MinifyScript\execute(), CopyFileBackend\execute(), ImageBuilder\execute(), RefreshImageMetadata\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), UpdateCollation\execute(), CommandLineInstaller\execute(), BackupReader\execute(), PurgeChangedFiles\execute(), UpdateMediaWiki\execute(), DeleteEqualMessages\execute(), LoggedUpdateMaintenance\execute(), CopyFileBackend\filesAreSame(), GetConfiguration\finalSetup(), finalSetup(), FindHooks\getHooksFromDoc(), getOption(), globals(), BackupReader\importFromHandle(), MWDocGen\init(), loadSpecialVars(), maybeHelp(), RunJobs\memoryLimit(), RebuildLocalisationCache\memoryLimit(), PurgeChangedFiles\purgeFromLogType(), WatchlistCleanup\removeWatch(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), CommandLineInstaller\validateParamsAndArgs(), validateParamsAndArgs(), and PurgeChangedFiles\verbose().
Maintenance::isQuiet | ( | ) |
Definition at line 303 of file Maintenance.php.
References $mQuiet.
Referenced by 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.
$self | String The name of the script, if any |
$opts | Array An array of options, in form of key=>value |
$args | Array An array of command line arguments |
Definition at line 567 of file Maintenance.php.
References $args, $options, $self, array(), error(), global, loadSpecialVars(), and maybeHelp().
Referenced by setup(), and TemplateCategoriesTest\testTemplateCategories().
Maintenance::loadSettings | ( | ) |
Generic setup for most installs.
Returns the location of LocalSettings
Definition at line 910 of file Maintenance.php.
References $IP, $wgCommandLineMode, error(), and global.
|
protected |
Handle the special variables that are global to all scripts.
Definition at line 691 of file Maintenance.php.
References getOption(), and hasOption().
Referenced by loadParamsAndArgs().
|
private |
Lock the search index.
&$db | DatabaseBase object |
Definition at line 1028 of file Maintenance.php.
References array().
Referenced by relockSearchindex(), and updateSearchIndex().
|
protected |
Maybe show the help.
$force | boolean Whether to force the help to show, default false |
Reimplemented in CommandLineInc.
Definition at line 710 of file Maintenance.php.
References $mDependantParameters, $output, as, hasOption(), and output().
Referenced by JSParseHelper\execute(), GenerateJsonI18n\execute(), CreateAndPromote\execute(), PurgeChangedPages\execute(), PurgeChangedFiles\execute(), BackupReader\importFromStdin(), loadParamsAndArgs(), 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 RebuildLocalisationCache, and RunJobs.
Definition at line 530 of file Maintenance.php.
References $limit, and getOption().
Referenced by adjustMemoryLimit().
|
protected |
Throw some output to the user.
Scripts can call this with no fears, as we handle all –quiet stuff here
$out | String: the text to show to the user |
$channel | Mixed: unique identifier for the channel. See function outputChanneled. |
Reimplemented in MaintenanceFixup.
Definition at line 314 of file Maintenance.php.
References $out, cleanupChanneled(), and outputChanneled().
Referenced by ImageBuilder\addMissingImage(), SqliteMaintenance\backup(), ImageBuilder\buildTable(), Orphans\checkOrphans(), NamespaceConflictChecker\checkPrefix(), Orphans\checkSeparation(), SqliteMaintenance\checkSyntax(), Orphans\checkWidows(), CleanupSpam\cleanupArticle(), RebuildTextIndex\clearSearchIndex(), CompressOld\compressOldPages(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), RebuildTextIndex\createMysqlTextIndex(), ConvertLinks\createTempTable(), RefreshLinks\deleteLinksFromNonexistent(), CopyFileBackend\delFileBatch(), FixSlaveDesync\desyncFixPage(), PopulateRecentChangesSource\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), PopulateRevisionSha1\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateImageSha1\doDBUpdates(), DeleteOldRevisions\doDelete(), PopulateRevisionLength\doLenUpdates(), TestFileOpPerformance\doPerfTest(), PopulateCategory\doPopulateCategory(), PurgeList\doPurge(), ReassignEdits\doReassignEdits(), RebuildLocalisationCache\doRebuild(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), UpdateSpecialPages\doSpecialPageCacheUpdates(), UpdateSearchIndex\doUpdateSearchIndex(), RebuildTextIndex\dropMysqlTextIndex(), TidyUpBug37714\execute(), CleanupPreferences\execute(), Undelete\execute(), GetLagTimes\execute(), RebuildMessages\execute(), GetSlaveServer\execute(), CheckBadRedirects\execute(), BenchmarkPurge\execute(), FixUserRegistration\execute(), DatabaseLag\execute(), AllTrans\execute(), CountMessages\execute(), DumpRev\execute(), BenchmarkHooks\execute(), ClearInterwikiCache\execute(), CheckImages\execute(), RebuildRecentchanges\execute(), DumpMessages\execute(), DeleteRevision\execute(), DeleteSelfExternals\execute(), NextJobDB\execute(), CleanupAncientTables\execute(), JSParseHelper\execute(), DeleteDefaultMessages\execute(), BatchedQueryRunner\execute(), DateFormats\execute(), DeleteOldRevisions\execute(), MigrateUserGroup\execute(), ConvertUserOptions\execute(), GetTextMaint\execute(), ImportSiteScripts\execute(), InitEditCount\execute(), RemoveUnusedAccounts\execute(), LangMemUsage\execute(), DeleteOrphanedRevisions\execute(), NukePage\execute(), DumpSisterSites\execute(), CleanupSpam\execute(), PruneFileCache\execute(), RebuildAll\execute(), DeleteImageCache\execute(), UpdateArticleCount\execute(), UpdateRestrictions\execute(), UpdateSpecialPages\execute(), AlterSharedConstraints\execute(), bench_wfBaseConvert\execute(), CleanupRemovedModules\execute(), ShowCacheStats\execute(), Protect\execute(), PurgeList\execute(), ChangePassword\execute(), InitSiteStats\execute(), ResetUserTokens\execute(), McTest\execute(), OrphanStats\execute(), PatchSql\execute(), RollbackEdits\execute(), FixDoubleRedirects\execute(), CopyJobQueue\execute(), RefreshFileHeaders\execute(), RenameDbPrefix\execute(), ShowJobs\execute(), ShowSiteStats\execute(), UploadStashCleanup\execute(), EraseArchivedFile\execute(), AttachLatest\execute(), FixTimestamps\execute(), ReassignEdits\execute(), PurgeParserCache\execute(), DumpLinks\execute(), EditCLI\execute(), UpdateDoubleWidthSearch\execute(), DeleteArchivedRevisions\execute(), GenerateJsonI18n\execute(), DeleteArchivedFiles\execute(), Digit2Html\execute(), CreateAndPromote\execute(), SyncFileBackend\execute(), FetchText\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), DeleteBatch\execute(), TableCleanup\execute(), RebuildTextIndex\execute(), NamespaceConflictChecker\execute(), WatchlistCleanup\execute(), ConvertLinks\execute(), NukeNS\execute(), CopyFileBackend\execute(), MoveBatch\execute(), RefreshImageMetadata\execute(), FindHooks\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), UpdateCollation\execute(), CompressOld\execute(), BackupReader\execute(), UpdateMediaWiki\execute(), DeleteEqualMessages\execute(), MWDocGen\execute(), GetConfiguration\execute(), LoggedUpdateMaintenance\execute(), DeleteEqualMessages\fetchMessageInfo(), ImportSiteScripts\fetchScriptList(), FixSlaveDesync\findPageLatestCorruption(), GetConfiguration\formatVarDump(), DeleteArchivedFiles\handleOutput(), DeleteArchivedRevisions\handleOutput(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), MWDocGen\init(), SqliteMaintenance\integrityCheck(), ImageCleanup\killRow(), maybeHelp(), MinifyScript\minify(), TitleCleanup\moveIllegalPage(), TitleCleanup\moveInconsistentPage(), ImageBuilder\oldimageCallback(), UploadDumper\outputItem(), ImageCleanup\pokeFile(), RebuildTextIndex\populateSearchIndex(), FindHooks\printArray(), CompareParsers\processRevision(), SearchDump\processRevision(), TitleCleanup\processRow(), ImageCleanup\processRow(), WatchlistCleanup\processRow(), CapsCleanup\processRow(), TableCleanup\progress(), ImageBuilder\progress(), PruneFileCache\prune_directory(), RebuildRecentchanges\purgeFeeds(), PurgeChangedFiles\purgeFromArchiveTable(), purgeRedundantText(), FixDoubleRedirects\queueJobs(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), WatchlistCleanup\removeWatch(), NamespaceConflictChecker\reportConflict(), NamespaceConflictChecker\resolveConflict(), NamespaceConflictChecker\resolveConflictOn(), RunJobs\runJobsLog(), TableCleanup\runTable(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), GenerateJsonI18n\shimOnly(), PurgeParserCache\showProgress(), UpdateCollation\showSortKeySizeHistogram(), MwSql\sqlPrintResult(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), updateSearchIndex(), updateSearchIndexForPage(), ResetUserTokens\updateUser(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionLength\upgradeRow(), PopulateRevisionSha1\upgradeRow(), SqliteMaintenance\vacuum(), and PurgeChangedFiles\verbose().
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.
$msg | String: the message without trailing newline |
$channel | string Channel identifier or null for no channel. Channel comparison uses ===. |
Reimplemented in MaintenanceFixup.
Definition at line 367 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.
$fd | int File descriptor |
Definition at line 1121 of file Maintenance.php.
Referenced by MwSql\execute(), and readconsole().
Maintenance::purgeRedundantText | ( | $delete = true | ) |
Support function for cleaning up redundant text records.
$delete | Boolean: whether or not to actually delete the records |
Definition at line 943 of file Maintenance.php.
References $count, $res, array(), as, DB_MASTER, getDB(), and output().
Referenced by DeleteOldRevisions\doDelete(), PurgeOldText\execute(), NukePage\execute(), DeleteOrphanedRevisions\execute(), and NukeNS\execute().
|
static |
Prompt the console for input.
$prompt | String what to begin the line with, like '> ' |
Definition at line 1134 of file Maintenance.php.
References posix_isatty(), and readlineEmulation().
Referenced by MwSql\execute().
|
staticprivate |
Emulate readline()
$prompt | String what to begin the line with, like '> ' |
Definition at line 1165 of file Maintenance.php.
References $command, $line, $retval, array(), Installer\locateExecutableInDefaultPaths(), 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.
&$db | DatabaseBase object |
Definition at line 1047 of file Maintenance.php.
References lockSearchindex(), and unlockSearchindex().
Referenced by updateSearchIndex().
Maintenance::runChild | ( | $maintClass, | |
$classFile = null |
|||
) |
Run a child maintenance script.
Pass all of the current arguments to it.
$maintClass | String: a name of a child maintenance class |
$classFile | String: full path of where the child is |
Definition at line 444 of file Maintenance.php.
References $maintClass, and error().
Referenced by RebuildAll\execute(), NukeNS\execute(), and UpdateMediaWiki\execute().
|
protected |
Set the batch size.
$s | Integer: the number of operations to do in a batch |
Definition at line 254 of file Maintenance.php.
References $s, and addOption().
Referenced by CheckImages\__construct(), MigrateUserGroup\__construct(), PurgeList\__construct(), RebuildFileCache\__construct(), RefreshLinks\__construct(), PopulateRecentChangesSource\__construct(), SyncFileBackend\__construct(), PopulateRevisionLength\__construct(), PopulateRevisionSha1\__construct(), ConvertUserOptions\__construct(), RefreshFileHeaders\__construct(), ResetUserTokens\__construct(), CopyJobQueue\__construct(), UpdateRestrictions\__construct(), PopulateLogUsertext\__construct(), PopulateLogSearch\__construct(), CheckUsernames\__construct(), PurgeChangedPages\__construct(), UploadStashCleanup\__construct(), CopyFileBackend\__construct(), RefreshImageMetadata\__construct(), PurgeChangedFiles\__construct(), and LoggedUpdateMaintenance\__construct().
Maintenance::setDB | ( | & | $db | ) |
Sets database object to be returned by getDB().
$db | DatabaseBase: Database object to be used |
Definition at line 1020 of file Maintenance.php.
Referenced by DatabaseUpdater\__construct().
Maintenance::setup | ( | ) |
Do some sanity checking and basic setup.
Definition at line 469 of file Maintenance.php.
References $IP, $wgCommandLineMode, $wgRequestTime, adjustMemoryLimit(), error(), global, 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 136 of file Maintenance.php.
|
private |
Unlock the tables.
&$db | DatabaseBase object |
Definition at line 1038 of file Maintenance.php.
Referenced by relockSearchindex(), and updateSearchIndex().
Maintenance::updateSearchIndex | ( | $maxLockTime, | |
$callback, | |||
$dbw, | |||
$results | |||
) |
Perform a search index update with locking.
$maxLockTime | Integer: the maximum time to keep the search index locked. |
$callback | callback String: the function that will update the function. |
$dbw | DatabaseBase object |
$results |
Definition at line 1059 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.
$dbw | DatabaseBase a database write handle |
$pageId | Integer: the page ID to update. |
Definition at line 1097 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 666 of file Maintenance.php.
References as, error(), hasArg(), hasOption(), and maybeHelp().
Referenced by setup().
|
private |
Definition at line 346 of file Maintenance.php.
resource Maintenance::$fileHandle |
Used when creating separate schema files.
Definition at line 112 of file Maintenance.php.
|
private |
Definition at line 347 of file Maintenance.php.
|
protected |
Definition at line 71 of file Maintenance.php.
|
protected |
Definition at line 77 of file Maintenance.php.
Referenced by SqliteMaintenance\checkSyntax(), JSParseHelper\execute(), and CommandLineInc\execute().
|
protected |
Batch size.
If a script supports this, they should set a default with setBatchSize()
Definition at line 97 of file Maintenance.php.
Referenced by PopulateRecentChangesSource\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateRevisionLength\doLenUpdates(), PopulateRevisionSha1\doSha1Updates(), MigrateUserGroup\execute(), ResetUserTokens\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), and RefreshImageMetadata\execute().
|
private |
Maintenance::$mDbPass |
Definition at line 84 of file Maintenance.php.
Referenced by finalSetup().
|
protected |
Definition at line 84 of file Maintenance.php.
Referenced by finalSetup().
|
private |
Definition at line 102 of file Maintenance.php.
Referenced by maybeHelp().
|
protected |
Definition at line 87 of file Maintenance.php.
|
private |
Definition at line 100 of file Maintenance.php.
|
protected |
Definition at line 90 of file Maintenance.php.
|
protected |
Definition at line 74 of file Maintenance.php.
Referenced by CommandLineInc\execute().
|
protected |
Definition at line 65 of file Maintenance.php.
Referenced by addDefaultParams().
|
protected |
Definition at line 83 of file Maintenance.php.
Referenced by isQuiet().
|
protected |
Definition at line 80 of file Maintenance.php.
Referenced by getName().
|
protected |
Definition at line 68 of file Maintenance.php.
const Maintenance::DB_ADMIN = 2 |
Definition at line 59 of file Maintenance.php.
Referenced by FixSlaveDesync\getDbType(), RebuildAll\getDbType(), AlterSharedConstraints\getDbType(), PatchSql\getDbType(), RenameDbPrefix\getDbType(), UpdateDoubleWidthSearch\getDbType(), RebuildTextIndex\getDbType(), ConvertLinks\getDbType(), UpdateSearchIndex\getDbType(), BatchedQueryRunner\getDbType(), PHPUnitMaintClass\getDbType(), and MwSql\getDbType().
const Maintenance::DB_NONE = 0 |
Constants for DB access type.
Definition at line 57 of file Maintenance.php.
Referenced by DumpIterator\finalSetup(), GenerateRandomImages\getDbType(), ShowCacheStats\getDbType(), GenerateNormalizerDataMl\getDbType(), GenerateNormalizerDataAr\getDbType(), GenerateUtf8Case\getDbType(), SqliteMaintenance\getDbType(), PreprocessDump\getDbType(), FindHooks\getDbType(), MWDocGen\getDbType(), and SearchDump\getDbType().
const Maintenance::DB_STD = 1 |
Definition at line 58 of file Maintenance.php.
Referenced by getDbType().
const Maintenance::STDIN_ALL = 'all' |
Definition at line 62 of file Maintenance.php.
Referenced by EditCLI\execute(), and getStdin().