MediaWiki  REL1_22
Maintenance Class Reference

Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort. More...

Inherited by AllTrans, AlterSharedConstraints, AttachLatest, BackupReader, BatchedQueryRunner, Benchmarker, ChangePassword, CheckBadRedirects, CheckImages, CheckLess, CheckSyntax, 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, GenerateNormalizerData, GenerateRandomImages, GenerateSitemap, 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.

Collaboration diagram for Maintenance:

List of all members.

Public Member Functions

 __construct ()
 Default constructor.
 cleanupChanneled ()
 Clean up channeled output.
 clearParamsAndArgs ()
 Clear all params and arguments.
 execute ()
 Do the actual work.
 finalSetup ()
 Handle some last-minute setup here.
 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.
 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.
 setDB (&$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.

Static Public Member Functions

static getMaintenanceScripts ()
 Get the list of available maintenance scripts.
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 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.
 $mDbPass
const DB_ADMIN = 2
const DB_NONE = 0
 Constants for DB access type.
const DB_STD = 1
const STDIN_ALL = 'all'

Protected Member Functions

 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)
 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.
 deleteOption ($name)
 Remove an option.
 error ($err, $die=0)
 Throw an error to the user.
 getArg ($argId=0, $default=null)
 Get an argument.
getDB ($db, $groups=array(), $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 param 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.
 setBatchSize ($s=0)
 Set the batch size.
 validateParamsAndArgs ()
 Run some validation checks on the params, etc.

Static Protected Member Functions

static getCoreScripts ()
 Return all of the core maintenance scripts.

Protected Attributes

 $mArgList = array()
 $mArgs = array()
int $mBatchSize = null
 Batch size.
 $mDbUser
 $mDescription = ''
 $mInputLoaded = false
 $mOptions = array()
 $mParams = array()
 $mQuiet = false
 $mSelf
 $mShortParamsMap = array()

Static Protected Attributes

static $mCoreScripts = null
 List of all the core maintenance scripts.

Private Member Functions

public function __construct ()
public function execute ()
 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.
 unlockSearchindex (&$db)
 Unlock the tables.

Static Private Member Functions

static readlineEmulation ($prompt)
 Emulate readline()

Private Attributes

 $atLineStart = true
 $lastChannel = null
DatabaseBase $mDb = null
 Used by getDD() / setDB()
 $mDependantParameters = array()
 $mGenericParameters = array()

Detailed Description

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.

Author:
Chad Horohoe <[email protected]>
Since:
1.16

Definition at line 39 of file maintenance.txt.


Constructor & Destructor Documentation

Default constructor.

Children should call this *first* if implementing their own constructors

Reimplemented in LoggedUpdateMaintenance, SearchDump, GenerateSitemap, GenerateJqueryMsgData, CLIParser, PurgeChangedFiles, CompressOld, GenerateCollationData, GetConfiguration, ImageCleanup, WatchlistCleanup, MWDocGen, PreprocessDump, TableCleanup, ImageBuilder, FindHooks, MoveBatch, 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, bench_utf8_title_check, UploadStashCleanup, PurgeChangedPages, AttachLatest, CheckSyntax, ConvertLinks, ConvertUserOptions, CreateAndPromote, DeleteArchivedRevisions, FixTimestamps, GenerateNormalizerData, ShowJobs, FixBug20757, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CheckUsernames, DeleteArchivedFiles, DumpSisterSites, EraseArchivedFile, FixDoubleRedirects, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, RunJobs, UpdateArticleCount, UpdateRestrictions, ChangePassword, CleanupRemovedModules, 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, PopulateRevisionSha1, RebuildRecentchanges, RemoveUnusedAccounts, RenameDbPrefix, RollbackEdits, BatchedQueryRunner, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CleanupSpam, ClearCacheStats, ClearInterwikiCache, DeleteOldRevisions, DeleteSelfExternals, UploadDumper, FetchText, TestFileOpPerformance, FixSlaveDesync, FixUserRegistration, ImportSiteScripts, AllTrans, CountMessages, AlterSharedConstraints, PatchSql, PopulateFilearchiveSha1, PopulateRevisionLength, PurgeOldText, RebuildAll, ShowCacheStats, MwSql, DumpRev, OrphanStats, SyncFileBackend, UpdateSpecialPages, WaitForSlave, CheckBadRedirects, CheckImages, CommandLineInc, EditCLI, MaintenanceFormatInstallDoc, GetLagTimes, GetSlaveServer, DatabaseLag, MigrateUserGroup, nextJobDB, PopulateImageSha1, Protect, PurgeList, RebuildFileCache, RebuildMessages, RefreshLinks, SqliteMaintenance, DeleteEqualMessages, CheckLess, InitEditCount, Undelete, and PHPUnitMaintClass.

Definition at line 125 of file Maintenance.php.


Member Function Documentation

public function Maintenance::__construct ( ) [inline, private]

Reimplemented in LoggedUpdateMaintenance, SearchDump, GenerateSitemap, GenerateJqueryMsgData, CLIParser, PurgeChangedFiles, CompressOld, GenerateCollationData, GetConfiguration, ImageCleanup, WatchlistCleanup, MWDocGen, PreprocessDump, TableCleanup, ImageBuilder, FindHooks, MoveBatch, 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, bench_utf8_title_check, UploadStashCleanup, PurgeChangedPages, AttachLatest, CheckSyntax, ConvertLinks, ConvertUserOptions, CreateAndPromote, DeleteArchivedRevisions, FixTimestamps, GenerateNormalizerData, ShowJobs, FixBug20757, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CheckUsernames, DeleteArchivedFiles, DumpSisterSites, EraseArchivedFile, FixDoubleRedirects, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, RunJobs, UpdateArticleCount, UpdateRestrictions, ChangePassword, CleanupRemovedModules, 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, PopulateRevisionSha1, RebuildRecentchanges, RemoveUnusedAccounts, RenameDbPrefix, RollbackEdits, BatchedQueryRunner, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CleanupSpam, ClearCacheStats, ClearInterwikiCache, DeleteOldRevisions, DeleteSelfExternals, UploadDumper, FetchText, TestFileOpPerformance, FixSlaveDesync, FixUserRegistration, ImportSiteScripts, AllTrans, CountMessages, AlterSharedConstraints, PatchSql, PopulateFilearchiveSha1, PopulateRevisionLength, PurgeOldText, RebuildAll, ShowCacheStats, MwSql, DumpRev, OrphanStats, SyncFileBackend, UpdateSpecialPages, WaitForSlave, CheckBadRedirects, CheckImages, CommandLineInc, EditCLI, MaintenanceFormatInstallDoc, GetLagTimes, GetSlaveServer, DatabaseLag, MigrateUserGroup, nextJobDB, PopulateImageSha1, Protect, PurgeList, RebuildFileCache, RebuildMessages, RefreshLinks, SqliteMaintenance, DeleteEqualMessages, CheckLess, InitEditCount, Undelete, and PHPUnitMaintClass.

Definition at line 41 of file maintenance.txt.

Add the default parameters to the scripts.

Definition at line 413 of file Maintenance.php.

Maintenance::addDescription ( text) [protected]

Set the description text.

Parameters:
$textString: the text of the description

Definition at line 234 of file Maintenance.php.

Referenced by PurgeParserCache\__construct().

Maintenance::addOption ( name,
description,
required = false,
withArg = false,
shortName = false 
) [protected]

Add a parameter to the script.

Will be displayed on --help with the associated description

Parameters:
$nameString: the name of the param (help, version, etc)
$descriptionString: the description of the param to show on --help
$requiredBoolean: is the param required?
$withArgBoolean: is an argument required with this option?
$shortNameString: character to use as short name

Definition at line 176 of file Maintenance.php.

Referenced by PHPUnitMaintClass\__construct(), Undelete\__construct(), InitEditCount\__construct(), DeleteEqualMessages\__construct(), CommandLineInc\__construct(), GetSlaveServer\__construct(), RebuildFileCache\__construct(), RefreshLinks\__construct(), MaintenanceFormatInstallDoc\__construct(), DatabaseLag\__construct(), SqliteMaintenance\__construct(), EditCLI\__construct(), nextJobDB\__construct(), PopulateImageSha1\__construct(), Protect\__construct(), PurgeList\__construct(), ImportSiteScripts\__construct(), MwSql\__construct(), DeleteOldRevisions\__construct(), SyncFileBackend\__construct(), UpdateSpecialPages\__construct(), CleanupSpam\__construct(), UploadDumper\__construct(), TestFileOpPerformance\__construct(), PurgeOldText\__construct(), GetTextMaint\__construct(), RemoveUnusedAccounts\__construct(), RenameDbPrefix\__construct(), RollbackEdits\__construct(), InitSiteStats\__construct(), mcTest\__construct(), bench_wfBaseConvert\__construct(), MinifyScript\__construct(), NukePage\__construct(), CleanupAncientTables\__construct(), ReassignEdits\__construct(), PurgeParserCache\__construct(), RefreshFileHeaders\__construct(), ChangePassword\__construct(), CleanupRemovedModules\__construct(), ResetUserTokens\__construct(), DeleteImageCache\__construct(), UpdateDoubleWidthSearch\__construct(), DeleteOrphanedRevisions\__construct(), CopyJobQueue\__construct(), PruneFileCache\__construct(), DeleteArchivedFiles\__construct(), RunJobs\__construct(), UpdateArticleCount\__construct(), PopulateCategory\__construct(), EraseArchivedFile\__construct(), FixDoubleRedirects\__construct(), CreateAndPromote\__construct(), AttachLatest\__construct(), DeleteArchivedRevisions\__construct(), FixBug20757\__construct(), CheckSyntax\__construct(), ShowJobs\__construct(), GenerateNormalizerData\__construct(), PurgeChangedPages\__construct(), CopyFileBackend\__construct(), DeleteBatch\__construct(), UpdateSearchIndex\__construct(), CommandLineInstaller\__construct(), Benchmarker\__construct(), Orphans\__construct(), RebuildLocalisationCache\__construct(), CapsCleanup\__construct(), NamespaceConflictChecker\__construct(), DumpIterator\__construct(), UpdateMediaWiki\__construct(), BackupReader\__construct(), MergeMessageFileList\__construct(), RefreshImageMetadata\__construct(), CompareParsers\__construct(), UpdateCollation\__construct(), DumpRenderer\__construct(), FindHooks\__construct(), MoveBatch\__construct(), NukeNS\__construct(), TableCleanup\__construct(), ImageBuilder\__construct(), PreprocessDump\__construct(), MWDocGen\__construct(), WatchlistCleanup\__construct(), GetConfiguration\__construct(), GenerateCollationData\__construct(), CompressOld\__construct(), PurgeChangedFiles\__construct(), CLIParser\__construct(), and SearchDump\__construct().

Adjusts PHP's memory limit to better suit our needs, if needed.

Definition at line 546 of file Maintenance.php.

Execute a callback function at the end of initialisation.

Reimplemented in UpdateMediaWiki.

Definition at line 898 of file Maintenance.php.

Clean up channeled output.

Output a newline if necessary.

Definition at line 359 of file Maintenance.php.

Clear all params and arguments.

Definition at line 559 of file Maintenance.php.

Maintenance::deleteOption ( name) [protected]

Remove an option.

Useful for removing options that won't be used in your script.

Parameters:
$nameString: the option to remove.

Definition at line 226 of file Maintenance.php.

Maintenance::error ( err,
die = 0 
) [protected]

Throw an error to the user.

Doesn't respect --quiet, so don't use this for non-error output

Parameters:
$errString: the error to display
$dieInt: if > 0, go ahead and die out using this int as the code

Definition at line 340 of file Maintenance.php.

Referenced by SqliteMaintenance\backup(), CheckSyntax\buildFileList(), ImageCleanup\buildSafeTitle(), CompareParsers\checkOptions(), SqliteMaintenance\checkSyntax(), CleanupSpam\cleanupArticle(), UpdateMediaWiki\compatChecks(), CompressOld\compressPage(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), CopyFileBackend\delFileBatch(), PopulateRevisionSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateImageSha1\doDBUpdates(), UpdateSpecialPages\doSpecialPageCacheUpdates(), CheckLess\execute(), Undelete\execute(), GetLagTimes\execute(), DumpRev\execute(), BenchmarkPurge\execute(), MaintenanceFormatInstallDoc\execute(), DeleteRevision\execute(), BatchedQueryRunner\execute(), MwSql\execute(), DeleteDefaultMessages\execute(), MigrateUserGroup\execute(), CleanupAncientTables\execute(), GetTextMaint\execute(), RemoveUnusedAccounts\execute(), ImportSiteScripts\execute(), CleanupSpam\execute(), LangMemUsage\execute(), CheckUsernames\execute(), PruneFileCache\execute(), ShowCacheStats\execute(), UpdateSpecialPages\execute(), UpdateRestrictions\execute(), Protect\execute(), ChangePassword\execute(), RollbackEdits\execute(), GenerateNormalizerData\execute(), OrphanStats\execute(), mcTest\execute(), UploadStashCleanup\execute(), PatchSql\execute(), EraseArchivedFile\execute(), FixDoubleRedirects\execute(), RenameDbPrefix\execute(), CopyJobQueue\execute(), EditCLI\execute(), FixTimestamps\execute(), ReassignEdits\execute(), CapsCleanup\execute(), PurgeParserCache\execute(), UpdateDoubleWidthSearch\execute(), Digit2Html\execute(), CreateAndPromote\execute(), SyncFileBackend\execute(), DumpIterator\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), DeleteBatch\execute(), RebuildTextIndex\execute(), SqliteMaintenance\execute(), DumpRenderer\execute(), MergeMessageFileList\execute(), ConvertLinks\execute(), RunJobs\execute(), UpdateSearchIndex\execute(), MoveBatch\execute(), MinifyScript\execute(), CopyFileBackend\execute(), RefreshImageMetadata\execute(), GenerateCollationData\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), CompressOld\execute(), CommandLineInstaller\execute(), BackupReader\execute(), DeleteEqualMessages\execute(), UpdateMediaWiki\execute(), MWDocGen\execute(), GenerateNormalizerData\generateArabic(), GenerateCollationData\generateFirstChars(), MinifyScript\getExtension(), CheckSyntax\getGitModifiedFiles(), CopyFileBackend\getListingDiffRel(), BackupReader\getNsIndex(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), ReassignEdits\initialiseUser(), SqliteMaintenance\integrityCheck(), MinifyScript\minify(), TitleCleanup\moveInconsistentPage(), ImageCleanup\pokeFile(), PreprocessDump\processRevision(), CompareParsers\processRevision(), BackupReader\skippedNamespace(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), RefreshFileHeaders\updateFileHeaders(), SqliteMaintenance\vacuum(), GetConfiguration\validateParamsAndArgs(), and CLIParser\Wikitext().

public function Maintenance::execute ( ) [inline, private]

Reimplemented in LoggedUpdateMaintenance, FakeMaintenance, GenerateSitemap, MaintenanceFixup, GetConfiguration, MWDocGen, UpdateMediaWiki, DeleteEqualMessages, GenerateJqueryMsgData, BackupReader, bench_utf8_title_check, PurgeChangedFiles, CommandLineInstaller, CompressOld, UpdateCollation, CLIParser, RebuildLocalisationCache, PHPUnitMaintClass, GenerateCollationData, PopulateCategory, RefreshImageMetadata, ImageBuilder, CopyFileBackend, FindHooks, MinifyScript, MoveBatch, WatchlistCleanup, ConvertLinks, NukeNS, RunJobs, UpdateSearchIndex, CheckSyntax, MergeMessageFileList, DumpRenderer, TableCleanup, NamespaceConflictChecker, RebuildTextIndex, SqliteMaintenance, CommandLineInc, DeleteBatch, PurgeChangedPages, RebuildFileCache, DumpIterator, Orphans, PopulateImageSha1, bench_strtr_str_replace, CreateAndPromote, FetchText, SyncFileBackend, DeleteArchivedFiles, DeleteArchivedRevisions, Digit2Html, CapsCleanup, DumpLinks, PurgeParserCache, UpdateDoubleWidthSearch, FixTimestamps, ReassignEdits, RefreshLinks, CopyJobQueue, EditCLI, EraseArchivedFile, TestFileOpPerformance, FixDoubleRedirects, RefreshFileHeaders, RenameDbPrefix, ShowJobs, ShowSiteStats, FixBug20757, AttachLatest, ChangePassword, UploadStashCleanup, UploadDumper, InitSiteStats, GenerateNormalizerData, mcTest, PatchSql, Protect, PurgeList, ResetUserTokens, RollbackEdits, OrphanStats, bench_wfBaseConvert, CheckUsernames, CleanupRemovedModules, ConvertUserOptions, DeleteImageCache, FixSlaveDesync, AlterSharedConstraints, PruneFileCache, RebuildAll, ShowCacheStats, UpdateArticleCount, UpdateRestrictions, UpdateSpecialPages, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CleanupSpam, DeleteOrphanedRevisions, DumpSisterSites, GetTextMaint, ImportSiteScripts, InitEditCount, LangMemUsage, NukePage, RemoveUnusedAccounts, CleanupAncientTables, DeleteDefaultMessages, DeleteOldRevisions, JSParseHelper, DateFormats, MigrateUserGroup, BatchedQueryRunner, MwSql, DeleteRevision, DeleteSelfExternals, MaintenanceFormatInstallDoc, DumpMessages, nextJobDB, PurgeOldText, RebuildRecentchanges, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CheckImages, ClearCacheStats, ClearInterwikiCache, FixUserRegistration, DatabaseLag, AllTrans, CountMessages, DumpRev, CheckBadRedirects, GetLagTimes, GetSlaveServer, RebuildMessages, WaitForSlave, CheckLess, Undelete, CleanupPreferences, StorageTypeStats, GenerateRandomImages, and TidyUpBug37714.

Definition at line 45 of file maintenance.txt.

Maintenance::execute ( ) [abstract]

Do the actual work.

All child classes will need to implement this

Reimplemented in LoggedUpdateMaintenance, FakeMaintenance, GenerateSitemap, MaintenanceFixup, GetConfiguration, MWDocGen, UpdateMediaWiki, DeleteEqualMessages, GenerateJqueryMsgData, BackupReader, bench_utf8_title_check, PurgeChangedFiles, CommandLineInstaller, CompressOld, UpdateCollation, CLIParser, RebuildLocalisationCache, PHPUnitMaintClass, GenerateCollationData, PopulateCategory, RefreshImageMetadata, ImageBuilder, CopyFileBackend, FindHooks, MinifyScript, MoveBatch, WatchlistCleanup, ConvertLinks, NukeNS, RunJobs, UpdateSearchIndex, CheckSyntax, MergeMessageFileList, DumpRenderer, TableCleanup, NamespaceConflictChecker, RebuildTextIndex, SqliteMaintenance, CommandLineInc, DeleteBatch, PurgeChangedPages, RebuildFileCache, DumpIterator, Orphans, PopulateImageSha1, bench_strtr_str_replace, CreateAndPromote, FetchText, SyncFileBackend, DeleteArchivedFiles, DeleteArchivedRevisions, Digit2Html, CapsCleanup, DumpLinks, PurgeParserCache, UpdateDoubleWidthSearch, FixTimestamps, ReassignEdits, RefreshLinks, CopyJobQueue, EditCLI, EraseArchivedFile, TestFileOpPerformance, FixDoubleRedirects, RefreshFileHeaders, RenameDbPrefix, ShowJobs, ShowSiteStats, FixBug20757, AttachLatest, ChangePassword, UploadStashCleanup, UploadDumper, InitSiteStats, GenerateNormalizerData, mcTest, PatchSql, Protect, PurgeList, ResetUserTokens, RollbackEdits, OrphanStats, bench_wfBaseConvert, CheckUsernames, CleanupRemovedModules, ConvertUserOptions, DeleteImageCache, FixSlaveDesync, AlterSharedConstraints, PruneFileCache, RebuildAll, ShowCacheStats, UpdateArticleCount, UpdateRestrictions, UpdateSpecialPages, bench_HTTP_HTTPS, bench_if_switch, bench_wfIsWindows, CleanupSpam, DeleteOrphanedRevisions, DumpSisterSites, GetTextMaint, ImportSiteScripts, InitEditCount, LangMemUsage, NukePage, RemoveUnusedAccounts, CleanupAncientTables, DeleteDefaultMessages, DeleteOldRevisions, JSParseHelper, DateFormats, MigrateUserGroup, BatchedQueryRunner, MwSql, DeleteRevision, DeleteSelfExternals, MaintenanceFormatInstallDoc, DumpMessages, nextJobDB, PurgeOldText, RebuildRecentchanges, BenchmarkDeleteTruncate, BenchmarkHooks, BenchmarkPurge, CheckImages, ClearCacheStats, ClearInterwikiCache, FixUserRegistration, DatabaseLag, AllTrans, CountMessages, DumpRev, CheckBadRedirects, GetLagTimes, GetSlaveServer, RebuildMessages, WaitForSlave, CheckLess, Undelete, CleanupPreferences, StorageTypeStats, GenerateRandomImages, and TidyUpBug37714.

Handle some last-minute setup here.

Reimplemented in DumpIterator, GetConfiguration, RebuildLocalisationCache, RebuildFileCache, and PHPUnitMaintClass.

Definition at line 833 of file Maintenance.php.

static Maintenance::getCoreScripts ( ) [static, protected]

Return all of the core maintenance scripts.

Returns:
array

Definition at line 1023 of file Maintenance.php.

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

Returns:
Integer

Reimplemented in SearchDump, MwSql, PHPUnitMaintClass, MWDocGen, BatchedQueryRunner, UpdateMediaWiki, PreprocessDump, FindHooks, ConvertLinks, UpdateSearchIndex, CheckSyntax, RebuildTextIndex, SqliteMaintenance, UpdateDoubleWidthSearch, RenameDbPrefix, PatchSql, FixSlaveDesync, AlterSharedConstraints, RebuildAll, ShowCacheStats, and GenerateRandomImages.

Definition at line 406 of file Maintenance.php.

Referenced by DumpIterator\finalSetup().

Maintenance::getDir ( ) [protected]

Get the maintenance directory.

Returns:
string

Definition at line 1004 of file Maintenance.php.

Get the list of available maintenance scripts.

Note that if you call this _before_ calling doMaintenance you won't have any extensions in it yet

Returns:
Array

Definition at line 1014 of file Maintenance.php.

Get the script's name.

Returns:
String

Definition at line 283 of file Maintenance.php.

Maintenance::getOption ( name,
default = null 
) [protected]

Get an option, or return the default.

Parameters:
$nameString: the name of the param
$defaultMixed: anything you want, default null
Returns:
Mixed

Definition at line 198 of file Maintenance.php.

Referenced by Benchmarker\bench(), CheckSyntax\buildFileList(), PreprocessDump\checkOptions(), CompareParsers\checkOptions(), SqliteMaintenance\checkSyntax(), PopulateImageSha1\doDBUpdates(), TestFileOpPerformance\doPerfTest(), PurgeList\doPurge(), Undelete\execute(), GetSlaveServer\execute(), BenchmarkPurge\execute(), nextJobDB\execute(), MaintenanceFormatInstallDoc\execute(), MwSql\execute(), NukePage\execute(), ImportSiteScripts\execute(), RemoveUnusedAccounts\execute(), UpdateSpecialPages\execute(), bench_wfBaseConvert\execute(), PruneFileCache\execute(), CleanupRemovedModules\execute(), DeleteImageCache\execute(), mcTest\execute(), UploadDumper\execute(), ChangePassword\execute(), Protect\execute(), PurgeList\execute(), GenerateNormalizerData\execute(), ResetUserTokens\execute(), RollbackEdits\execute(), EditCLI\execute(), FixBug20757\execute(), EraseArchivedFile\execute(), TestFileOpPerformance\execute(), CopyJobQueue\execute(), FixDoubleRedirects\execute(), RefreshFileHeaders\execute(), RenameDbPrefix\execute(), RefreshLinks\execute(), UpdateDoubleWidthSearch\execute(), PurgeParserCache\execute(), SyncFileBackend\execute(), PopulateImageSha1\execute(), DumpIterator\execute(), DeleteBatch\execute(), PurgeChangedPages\execute(), RebuildFileCache\execute(), SqliteMaintenance\execute(), NamespaceConflictChecker\execute(), DumpRenderer\execute(), MergeMessageFileList\execute(), RunJobs\execute(), NukeNS\execute(), UpdateSearchIndex\execute(), MoveBatch\execute(), MinifyScript\execute(), CopyFileBackend\execute(), RefreshImageMetadata\execute(), PopulateCategory\execute(), GenerateCollationData\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), UpdateCollation\execute(), CompressOld\execute(), CommandLineInstaller\execute(), BackupReader\execute(), DeleteEqualMessages\execute(), UpdateMediaWiki\execute(), GetConfiguration\execute(), GetConfiguration\finalSetup(), CLIParser\getTitle(), MWDocGen\init(), MinifyScript\minify(), CompareParsers\processRevision(), SearchDump\processRevision(), PurgeList\sendPurgeRequest(), SyncFileBackend\syncFileBatch(), and GetConfiguration\validateParamsAndArgs().

Maintenance::getStdin ( len = null) [protected]

Return input from stdin.

Parameters:
$lenInteger: the number of bytes to read. If null, just return the handle. Maintenance::STDIN_ALL returns the full length
Returns:
Mixed

Reimplemented in SemiMockedFetchText.

Definition at line 294 of file Maintenance.php.

Referenced by PurgeList\doPurge(), EditCLI\execute(), FetchText\execute(), DumpIterator\execute(), DeleteBatch\execute(), DumpRenderer\execute(), and MoveBatch\execute().

Potentially debug globals.

Originally a feature only for refreshLinks

Definition at line 908 of file Maintenance.php.

Maintenance::hasArg ( argId = 0) [protected]

Does a given argument exist?

Parameters:
$argIdInteger: the integer value (from zero) for the arg
Returns:
Boolean

Definition at line 243 of file Maintenance.php.

Referenced by MaintenanceFormatInstallDoc\execute(), JSParseHelper\execute(), BatchedQueryRunner\execute(), MwSql\execute(), FixSlaveDesync\execute(), mcTest\execute(), ReassignEdits\execute(), DeleteBatch\execute(), MoveBatch\execute(), and BackupReader\execute().

Maintenance::hasOption ( name) [protected]

Checks to see if a particular param exists.

Parameters:
$nameString: the name of the param
Returns:
Boolean

Definition at line 188 of file Maintenance.php.

Referenced by CheckSyntax\buildFileList(), CompareParsers\checkOptions(), PreprocessDump\checkOptions(), CleanupSpam\cleanupArticle(), CopyFileBackend\copyFileBatch(), ConvertLinks\createTempTable(), TestFileOpPerformance\doPerfTest(), GetSlaveServer\execute(), BenchmarkPurge\execute(), DatabaseLag\execute(), MaintenanceFormatInstallDoc\execute(), nextJobDB\execute(), PurgeOldText\execute(), MwSql\execute(), DeleteOldRevisions\execute(), CleanupAncientTables\execute(), GetTextMaint\execute(), CleanupSpam\execute(), InitEditCount\execute(), DeleteOrphanedRevisions\execute(), RemoveUnusedAccounts\execute(), UpdateArticleCount\execute(), UpdateSpecialPages\execute(), RollbackEdits\execute(), InitSiteStats\execute(), GenerateNormalizerData\execute(), AttachLatest\execute(), Protect\execute(), UploadDumper\execute(), PurgeList\execute(), ChangePassword\execute(), ShowJobs\execute(), EditCLI\execute(), EraseArchivedFile\execute(), RefreshFileHeaders\execute(), ReassignEdits\execute(), RefreshLinks\execute(), CapsCleanup\execute(), DeleteArchivedRevisions\execute(), DeleteArchivedFiles\execute(), CreateAndPromote\execute(), SyncFileBackend\execute(), Orphans\execute(), DumpIterator\execute(), PurgeChangedPages\execute(), SqliteMaintenance\execute(), TableCleanup\execute(), NamespaceConflictChecker\execute(), DumpRenderer\execute(), CheckSyntax\execute(), MergeMessageFileList\execute(), RunJobs\execute(), UpdateSearchIndex\execute(), WatchlistCleanup\execute(), ConvertLinks\execute(), MinifyScript\execute(), CopyFileBackend\execute(), ImageBuilder\execute(), RefreshImageMetadata\execute(), RebuildLocalisationCache\execute(), UpdateCollation\execute(), CommandLineInstaller\execute(), BackupReader\execute(), DeleteEqualMessages\execute(), UpdateMediaWiki\execute(), CopyFileBackend\filesAreSame(), GetConfiguration\finalSetup(), FindHooks\getHooksFromDoc(), BackupReader\importFromHandle(), MWDocGen\init(), RunJobs\memoryLimit(), RebuildLocalisationCache\memoryLimit(), WatchlistCleanup\removeWatch(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), and CommandLineInstaller\validateParamsAndArgs().

Returns:
bool

Definition at line 310 of file Maintenance.php.

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.

Parameters:
$selfString The name of the script, if any
$optsArray An array of options, in form of key=>value
$argsArray An array of command line arguments

Definition at line 574 of file Maintenance.php.

Referenced by TemplateCategoriesTest\testTemplateCategories().

Generic setup for most installs.

Returns the location of LocalSettings

Returns:
String

Definition at line 918 of file Maintenance.php.

Handle the special variables that are global to all scripts.

Definition at line 698 of file Maintenance.php.

Maintenance::lockSearchindex ( &$  db) [private]

Lock the search index.

Parameters:
&$dbDatabaseBase object

Definition at line 1082 of file Maintenance.php.

Maintenance::maybeHelp ( force = false) [protected]

Maybe show the help.

Parameters:
$forceboolean Whether to force the help to show, default false

Reimplemented in CommandLineInc.

Definition at line 717 of file Maintenance.php.

Referenced by JSParseHelper\execute(), CreateAndPromote\execute(), PurgeChangedPages\execute(), BackupReader\importFromStdin(), and GetConfiguration\validateParamsAndArgs().

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)

Returns:
string

Reimplemented in RebuildLocalisationCache, and RunJobs.

Definition at line 537 of file Maintenance.php.

Maintenance::output ( out,
channel = null 
) [protected]

Throw some output to the user.

Scripts can call this with no fears, as we handle all --quiet stuff here

Parameters:
$outString: the text to show to the user
$channelMixed: unique identifier for the channel. See function outputChanneled.

Reimplemented in MaintenanceFixup.

Definition at line 321 of file Maintenance.php.

Referenced by ImageBuilder\addMissingImage(), SqliteMaintenance\backup(), CheckSyntax\buildFileList(), ImageBuilder\buildTable(), CheckSyntax\checkEvilToken(), CheckSyntax\checkFileWithCli(), CheckSyntax\checkFileWithParsekit(), Orphans\checkOrphans(), CheckSyntax\checkRegex(), Orphans\checkSeparation(), SqliteMaintenance\checkSyntax(), Orphans\checkWidows(), CleanupSpam\cleanupArticle(), CompressOld\compressOldPages(), CompressOld\compressWithConcat(), CompareParsers\conclusions(), CopyFileBackend\copyFileBatch(), ConvertLinks\createTempTable(), RefreshLinks\deleteLinksFromNonexistent(), CopyFileBackend\delFileBatch(), FixSlaveDesync\desyncFixPage(), PopulateRevisionSha1\doDBUpdates(), PopulateFilearchiveSha1\doDBUpdates(), PopulateRevisionLength\doDBUpdates(), FixExtLinksProtocolRelative\doDBUpdates(), PopulateParentId\doDBUpdates(), PopulateLogSearch\doDBUpdates(), PopulateLogUsertext\doDBUpdates(), PopulateImageSha1\doDBUpdates(), DeleteOldRevisions\doDelete(), TestFileOpPerformance\doPerfTest(), PopulateCategory\doPopulateCategory(), PurgeList\doPurge(), ReassignEdits\doReassignEdits(), RebuildLocalisationCache\doRebuild(), RefreshLinks\doRefreshLinks(), PopulateRevisionSha1\doSha1LegacyUpdates(), PopulateRevisionSha1\doSha1Updates(), UpdateSpecialPages\doSpecialPageCacheUpdates(), UpdateSearchIndex\doUpdateSearchIndex(), TidyUpBug37714\execute(), CleanupPreferences\execute(), CheckLess\execute(), Undelete\execute(), RebuildMessages\execute(), GetLagTimes\execute(), GetSlaveServer\execute(), CheckBadRedirects\execute(), ClearInterwikiCache\execute(), BenchmarkPurge\execute(), FixUserRegistration\execute(), DumpRev\execute(), DatabaseLag\execute(), AllTrans\execute(), CountMessages\execute(), BenchmarkHooks\execute(), CheckImages\execute(), RebuildRecentchanges\execute(), DumpMessages\execute(), nextJobDB\execute(), DeleteRevision\execute(), DeleteSelfExternals\execute(), BatchedQueryRunner\execute(), DateFormats\execute(), MigrateUserGroup\execute(), DeleteDefaultMessages\execute(), DeleteOldRevisions\execute(), JSParseHelper\execute(), CleanupAncientTables\execute(), RemoveUnusedAccounts\execute(), GetTextMaint\execute(), CleanupSpam\execute(), ImportSiteScripts\execute(), InitEditCount\execute(), LangMemUsage\execute(), NukePage\execute(), DeleteOrphanedRevisions\execute(), DumpSisterSites\execute(), RebuildAll\execute(), UpdateSpecialPages\execute(), ConvertUserOptions\execute(), ShowCacheStats\execute(), UpdateArticleCount\execute(), UpdateRestrictions\execute(), bench_wfBaseConvert\execute(), DeleteImageCache\execute(), AlterSharedConstraints\execute(), CleanupRemovedModules\execute(), PruneFileCache\execute(), AttachLatest\execute(), OrphanStats\execute(), ResetUserTokens\execute(), RollbackEdits\execute(), ChangePassword\execute(), InitSiteStats\execute(), mcTest\execute(), PatchSql\execute(), UploadStashCleanup\execute(), Protect\execute(), PurgeList\execute(), EditCLI\execute(), EraseArchivedFile\execute(), FixDoubleRedirects\execute(), RefreshFileHeaders\execute(), RenameDbPrefix\execute(), CopyJobQueue\execute(), ShowSiteStats\execute(), ShowJobs\execute(), ReassignEdits\execute(), FixTimestamps\execute(), PurgeParserCache\execute(), UpdateDoubleWidthSearch\execute(), DumpLinks\execute(), DeleteArchivedFiles\execute(), DeleteArchivedRevisions\execute(), Digit2Html\execute(), FetchText\execute(), CreateAndPromote\execute(), SyncFileBackend\execute(), RebuildFileCache\execute(), PurgeChangedPages\execute(), DeleteBatch\execute(), RebuildTextIndex\execute(), TableCleanup\execute(), NamespaceConflictChecker\execute(), CheckSyntax\execute(), ConvertLinks\execute(), NukeNS\execute(), WatchlistCleanup\execute(), MoveBatch\execute(), FindHooks\execute(), CopyFileBackend\execute(), RefreshImageMetadata\execute(), PHPUnitMaintClass\execute(), RebuildLocalisationCache\execute(), CompressOld\execute(), UpdateCollation\execute(), BackupReader\execute(), DeleteEqualMessages\execute(), UpdateMediaWiki\execute(), MWDocGen\execute(), GetConfiguration\execute(), DeleteEqualMessages\fetchMessageInfo(), ImportSiteScripts\fetchScriptList(), FixSlaveDesync\findPageLatestCorruption(), GetConfiguration\formatVarDump(), DeleteArchivedRevisions\handleOutput(), DeleteArchivedFiles\handleOutput(), DumpRenderer\handleRevision(), DumpIterator\handleRevision(), MWDocGen\init(), SqliteMaintenance\integrityCheck(), ImageCleanup\killRow(), MinifyScript\minify(), TitleCleanup\moveIllegalPage(), TitleCleanup\moveInconsistentPage(), ImageBuilder\oldimageCallback(), UploadDumper\outputItem(), ImageCleanup\pokeFile(), FindHooks\printArray(), CompareParsers\processRevision(), SearchDump\processRevision(), TitleCleanup\processRow(), ImageCleanup\processRow(), WatchlistCleanup\processRow(), CapsCleanup\processRow(), TableCleanup\progress(), ImageBuilder\progress(), PruneFileCache\prune_directory(), RebuildRecentchanges\purgeFeeds(), FixDoubleRedirects\queueJobs(), RebuildRecentchanges\rebuildRecentChangesTablePass1(), RebuildRecentchanges\rebuildRecentChangesTablePass2(), RebuildRecentchanges\rebuildRecentChangesTablePass3(), RebuildRecentchanges\rebuildRecentChangesTablePass4(), WatchlistCleanup\removeWatch(), RunJobs\runJobsLog(), TableCleanup\runTable(), EraseArchivedFile\scrubVersion(), PurgeList\sendPurgeRequest(), PurgeParserCache\showProgress(), UpdateCollation\showSortKeySizeHistogram(), MwSql\sqlPrintResult(), SyncFileBackend\syncBackends(), SyncFileBackend\syncFileBatch(), ResetUserTokens\updateUser(), PopulateRevisionSha1\upgradeLegacyArchiveRow(), PopulateRevisionSha1\upgradeRow(), and SqliteMaintenance\vacuum().

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.

Parameters:
$msgString: the message without trailing newline
$channelstring Channel identifier or null for no channel. Channel comparison uses ===.

Reimplemented in MaintenanceFixup.

Definition at line 374 of file Maintenance.php.

static Maintenance::posix_isatty ( fd) [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.

Parameters:
$fdint File descriptor
Returns:
bool

Definition at line 1175 of file Maintenance.php.

Referenced by MwSql\execute().

Support function for cleaning up redundant text records.

Parameters:
$deleteBoolean: whether or not to actually delete the records
Author:
Rob Church <[email protected]>

Definition at line 951 of file Maintenance.php.

Referenced by DeleteOldRevisions\doDelete(), PurgeOldText\execute(), NukePage\execute(), DeleteOrphanedRevisions\execute(), and NukeNS\execute().

static Maintenance::readconsole ( prompt = ',
 
) [static]

Prompt the console for input.

Parameters:
$promptString what to begin the line with, like '> '
Returns:
String response

Definition at line 1188 of file Maintenance.php.

Referenced by MwSql\execute().

static Maintenance::readlineEmulation ( prompt) [static, private]

Emulate readline()

Parameters:
$promptString what to begin the line with, like '> '
Returns:
String

Definition at line 1219 of file Maintenance.php.

Maintenance::relockSearchindex ( &$  db) [private]

Unlock and lock again Since the lock is low-priority, queued reads will be able to complete.

Parameters:
&$dbDatabaseBase object

Definition at line 1101 of file Maintenance.php.

Maintenance::runChild ( maintClass,
classFile = null 
)

Run a child maintenance script.

Pass all of the current arguments to it.

Parameters:
$maintClassString: a name of a child maintenance class
$classFileString: full path of where the child is
Returns:
Maintenance child

Definition at line 451 of file Maintenance.php.

Referenced by RebuildAll\execute(), NukeNS\execute(), and UpdateMediaWiki\execute().

Maintenance::setDB ( &$  db)

Sets database object to be returned by getDB().

Parameters:
$dbDatabaseBase: Database object to be used

Definition at line 1074 of file Maintenance.php.

Do some sanity checking and basic setup.

Definition at line 476 of file Maintenance.php.

static Maintenance::shouldExecute ( ) [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)

Returns:
Boolean

Definition at line 143 of file Maintenance.php.

Maintenance::unlockSearchindex ( &$  db) [private]

Unlock the tables.

Parameters:
&$dbDatabaseBase object

Definition at line 1092 of file Maintenance.php.

Maintenance::updateSearchIndex ( maxLockTime,
callback,
dbw,
results 
)

Perform a search index update with locking.

Parameters:
$maxLockTimeInteger: the maximum time to keep the search index locked.
$callbackcallback String: the function that will update the function.
$dbwDatabaseBase object
$results

Definition at line 1113 of file Maintenance.php.

Referenced by UpdateSearchIndex\doUpdateSearchIndex(), and UpdateDoubleWidthSearch\execute().

Maintenance::updateSearchIndexForPage ( dbw,
pageId 
)

Update the searchindex table for a given pageid.

Parameters:
$dbwDatabaseBase a database write handle
$pageIdInteger: the page ID to update.
Returns:
null|string

Definition at line 1151 of file Maintenance.php.

Referenced by UpdateDoubleWidthSearch\searchIndexUpdateCallback(), and UpdateSearchIndex\searchIndexUpdateCallback().

Run some validation checks on the params, etc.

Reimplemented in CommandLineInstaller, and GetConfiguration.

Definition at line 673 of file Maintenance.php.


Member Data Documentation

Maintenance::$atLineStart = true [private]

Definition at line 353 of file Maintenance.php.

resource Maintenance::$fileHandle

Used when creating separate schema files.

Definition at line 112 of file Maintenance.php.

Maintenance::$lastChannel = null [private]

Definition at line 354 of file Maintenance.php.

Maintenance::$mArgList = array() [protected]

Definition at line 71 of file Maintenance.php.

Maintenance::$mArgs = array() [protected]

Definition at line 77 of file Maintenance.php.

int Maintenance::$mBatchSize = null [protected]

Batch size.

If a script supports this, they should set a default with setBatchSize()

Definition at line 97 of file Maintenance.php.

Maintenance::$mCoreScripts = null [static, protected]

List of all the core maintenance scripts.

This is added to scripts added by extensions in $wgMaintenanceScripts and returned by getMaintenanceScripts()

Definition at line 119 of file Maintenance.php.

DatabaseBase Maintenance::$mDb = null [private]

Used by getDD() / setDB()

Definition at line 107 of file Maintenance.php.

Maintenance::$mDbPass

Definition at line 84 of file Maintenance.php.

Maintenance::$mDbUser [protected]

Definition at line 84 of file Maintenance.php.

Maintenance::$mDependantParameters = array() [private]

Definition at line 102 of file Maintenance.php.

Maintenance::$mDescription = '' [protected]

Definition at line 87 of file Maintenance.php.

Maintenance::$mGenericParameters = array() [private]

Definition at line 100 of file Maintenance.php.

Maintenance::$mInputLoaded = false [protected]

Definition at line 90 of file Maintenance.php.

Maintenance::$mOptions = array() [protected]

Definition at line 74 of file Maintenance.php.

Maintenance::$mParams = array() [protected]

Definition at line 65 of file Maintenance.php.

Maintenance::$mQuiet = false [protected]

Definition at line 83 of file Maintenance.php.

Maintenance::$mSelf [protected]

Reimplemented in FakeMaintenance.

Definition at line 80 of file Maintenance.php.

Maintenance::$mShortParamsMap = array() [protected]

Definition at line 68 of file Maintenance.php.

Definition at line 58 of file Maintenance.php.

const Maintenance::STDIN_ALL = 'all'

Definition at line 62 of file Maintenance.php.

Referenced by EditCLI\execute().


The documentation for this class was generated from the following files: