MediaWiki  1.23.2
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, 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.

Collaboration diagram for Maintenance:

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()
 

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 chad@.nosp@m.anyo.nosp@m.necan.nosp@m.edit.nosp@m..org
Since
1.16

Definition at line 39 of file maintenance.txt.

Constructor & Destructor Documentation

◆ __construct()

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.

Member Function Documentation

◆ __construct()

public function Maintenance::__construct ( )
inlineprivate

Definition at line 41 of file maintenance.txt.

◆ addArg()

◆ addDefaultParams()

Maintenance::addDefaultParams ( )
protected

Add the default parameters to the scripts.

Definition at line 406 of file Maintenance.php.

References $mParams, addOption(), and getDbType().

Referenced by __construct().

◆ addDescription()

Maintenance::addDescription (   $text)
protected

Set the description text.

Parameters
$textString: the text of the description

Definition at line 227 of file Maintenance.php.

Referenced by PurgeParserCache\__construct(), and BenchmarkParse\__construct().

◆ addOption()

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 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().

◆ adjustMemoryLimit()

Maintenance::adjustMemoryLimit ( )
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().

◆ afterFinalSetup()

Maintenance::afterFinalSetup ( )
protected

Execute a callback function at the end of initialisation.

Reimplemented in UpdateMediaWiki.

Definition at line 890 of file Maintenance.php.

Referenced by finalSetup().

◆ cleanupChanneled()

Maintenance::cleanupChanneled ( )

Clean up channeled output.

Output a newline if necessary.

Definition at line 352 of file Maintenance.php.

Referenced by output(), and outputChanneled().

◆ clearParamsAndArgs()

Maintenance::clearParamsAndArgs ( )

Clear all params and arguments.

Definition at line 552 of file Maintenance.php.

References array().

◆ deleteOption()

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 219 of file Maintenance.php.

References $name.

◆ error()

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 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().

◆ execute() [1/2]

public function Maintenance::execute ( )
inlineprivate

Definition at line 45 of file maintenance.txt.

◆ execute() [2/2]

Maintenance::execute ( )
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.

◆ finalSetup()

◆ getArg()

◆ getDB()

◆ getDbType()

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

Returns
Integer

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().

◆ getDir()

Maintenance::getDir ( )
protected

Get the maintenance directory.

Returns
string

Definition at line 996 of file Maintenance.php.

◆ getName()

Maintenance::getName ( )

Get the script's name.

Returns
String

Definition at line 276 of file Maintenance.php.

References $mSelf.

◆ getOption()

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 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().

◆ getStdin()

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 287 of file Maintenance.php.

References $f, and STDIN_ALL.

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

◆ globals()

Maintenance::globals ( )

Potentially debug globals.

Originally a feature only for refreshLinks

Definition at line 900 of file Maintenance.php.

References $GLOBALS, and hasOption().

◆ hasArg()

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 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().

◆ hasOption()

Maintenance::hasOption (   $name)
protected

Checks to see if a particular param exists.

Parameters
$nameString: the name of the param
Returns
Boolean

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().

◆ isQuiet()

Maintenance::isQuiet ( )
Returns
bool

Definition at line 303 of file Maintenance.php.

References $mQuiet.

Referenced by SyncFileBackend\execute().

◆ loadParamsAndArgs()

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 567 of file Maintenance.php.

References $args, $options, $self, array(), error(), global, loadSpecialVars(), and maybeHelp().

Referenced by setup(), and TemplateCategoriesTest\testTemplateCategories().

◆ loadSettings()

Maintenance::loadSettings ( )

Generic setup for most installs.

Returns the location of LocalSettings

Returns
String

Definition at line 910 of file Maintenance.php.

References $IP, $wgCommandLineMode, error(), and global.

◆ loadSpecialVars()

Maintenance::loadSpecialVars ( )
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().

◆ lockSearchindex()

Maintenance::lockSearchindex ( $db)
private

Lock the search index.

Parameters
&$dbDatabaseBase object

Definition at line 1028 of file Maintenance.php.

References array().

Referenced by relockSearchindex(), and updateSearchIndex().

◆ maybeHelp()

Maintenance::maybeHelp (   $force = false)
protected

◆ memoryLimit()

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)

Returns
string

Reimplemented in RebuildLocalisationCache, and RunJobs.

Definition at line 530 of file Maintenance.php.

References $limit, and getOption().

Referenced by adjustMemoryLimit().

◆ output()

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 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().

◆ outputChanneled()

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 367 of file Maintenance.php.

References cleanupChanneled().

Referenced by error(), and output().

◆ posix_isatty()

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 1121 of file Maintenance.php.

Referenced by MwSql\execute(), and readconsole().

◆ purgeRedundantText()

Maintenance::purgeRedundantText (   $delete = true)

Support function for cleaning up redundant text records.

Parameters
$deleteBoolean: whether or not to actually delete the records
Author
Rob Church robch.nosp@m.ur@g.nosp@m.mail..nosp@m.com

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().

◆ readconsole()

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 1134 of file Maintenance.php.

References posix_isatty(), and readlineEmulation().

Referenced by MwSql\execute().

◆ readlineEmulation()

static Maintenance::readlineEmulation (   $prompt)
staticprivate

Emulate readline()

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

Definition at line 1165 of file Maintenance.php.

References $command, $line, $retval, array(), Installer\locateExecutableInDefaultPaths(), wfEscapeShellArg(), wfIsWindows(), and wfShellExec().

Referenced by readconsole().

◆ relockSearchindex()

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 1047 of file Maintenance.php.

References lockSearchindex(), and unlockSearchindex().

Referenced by updateSearchIndex().

◆ runChild()

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 444 of file Maintenance.php.

References $maintClass, and error().

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

◆ setBatchSize()

◆ setDB()

Maintenance::setDB ( $db)

Sets database object to be returned by getDB().

Parameters
$dbDatabaseBase: Database object to be used

Definition at line 1020 of file Maintenance.php.

Referenced by DatabaseUpdater\__construct().

◆ setup()

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().

◆ shouldExecute()

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 136 of file Maintenance.php.

References $count, and array().

◆ unlockSearchindex()

Maintenance::unlockSearchindex ( $db)
private

Unlock the tables.

Parameters
&$dbDatabaseBase object

Definition at line 1038 of file Maintenance.php.

Referenced by relockSearchindex(), and updateSearchIndex().

◆ updateSearchIndex()

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 1059 of file Maintenance.php.

References as, lockSearchindex(), output(), relockSearchindex(), and unlockSearchindex().

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

◆ updateSearchIndexForPage()

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 1097 of file Maintenance.php.

References $rev, $title, Revision\loadFromPageId(), and output().

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

◆ validateParamsAndArgs()

Maintenance::validateParamsAndArgs ( )
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().

Member Data Documentation

◆ $atLineStart

Maintenance::$atLineStart = true
private

Definition at line 346 of file Maintenance.php.

◆ $fileHandle

resource Maintenance::$fileHandle

Used when creating separate schema files.

Definition at line 112 of file Maintenance.php.

◆ $lastChannel

Maintenance::$lastChannel = null
private

Definition at line 347 of file Maintenance.php.

◆ $mArgList

Maintenance::$mArgList = array()
protected

Definition at line 71 of file Maintenance.php.

◆ $mArgs

Maintenance::$mArgs = array()
protected

◆ $mBatchSize

◆ $mDb

DatabaseBase Maintenance::$mDb = null
private

Used by getDD() / setDB()

Definition at line 107 of file Maintenance.php.

Referenced by getDB().

◆ $mDbPass

Maintenance::$mDbPass

Definition at line 84 of file Maintenance.php.

Referenced by finalSetup().

◆ $mDbUser

Maintenance::$mDbUser
protected

Definition at line 84 of file Maintenance.php.

Referenced by finalSetup().

◆ $mDependantParameters

Maintenance::$mDependantParameters = array()
private

Definition at line 102 of file Maintenance.php.

Referenced by maybeHelp().

◆ $mDescription

Maintenance::$mDescription = ''
protected

Definition at line 87 of file Maintenance.php.

◆ $mGenericParameters

Maintenance::$mGenericParameters = array()
private

Definition at line 100 of file Maintenance.php.

◆ $mInputLoaded

Maintenance::$mInputLoaded = false
protected

Definition at line 90 of file Maintenance.php.

◆ $mOptions

Maintenance::$mOptions = array()
protected

Definition at line 74 of file Maintenance.php.

Referenced by CommandLineInc\execute().

◆ $mParams

Maintenance::$mParams = array()
protected

Definition at line 65 of file Maintenance.php.

Referenced by addDefaultParams().

◆ $mQuiet

Maintenance::$mQuiet = false
protected

Definition at line 83 of file Maintenance.php.

Referenced by isQuiet().

◆ $mSelf

Maintenance::$mSelf
protected

Definition at line 80 of file Maintenance.php.

Referenced by getName().

◆ $mShortParamsMap

Maintenance::$mShortParamsMap = array()
protected

Definition at line 68 of file Maintenance.php.

◆ DB_ADMIN

◆ DB_NONE

◆ DB_STD

const Maintenance::DB_STD = 1

Definition at line 58 of file Maintenance.php.

Referenced by getDbType().

◆ STDIN_ALL

const Maintenance::STDIN_ALL = 'all'

Definition at line 62 of file Maintenance.php.

Referenced by EditCLI\execute(), and getStdin().


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