Maintenance Class Reference
[Maintenance]

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

Inherited by AddWiki, AllTrans, AttachLatest, BatchedQueryRunner, BenchmarkPurge, CacheStats, ChangePassword, CheckAutoLoader, CheckBadRedirects, CheckImages, CheckSyntax, CheckUsernames, CleanupSpam, clear_stats, ClearInterwikiCache, CommandLineInc, ConvertLinks, ConvertUserOptions, CountMessages, CreateAndPromote, DatabaseLag, DateFormats, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteBatch, DeleteDefaultMessages, DeleteImageCache, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteRevision, DeleteSelfExternals, Digit2Html, DumpLinks, DumpMessages, DumpRenderer, DumpRev, DumpSisterSites, EditCLI, FetchText, FindHooks, FixBug20757, FixSlaveDesync, FixTimestamps, FixUserRegistration, GenerateNormalizerData, GenerateSitemap, GetLagTimes, GetSlaveServer, GetTextMaint, HttpSessionDownload, InitEditCount, InitStats, Lang2Po, LangMemUsage, mcTest, MergeMessageFileList, MigrateUserGroup, MinifyScript, MoveBatch, MwSql, NamespaceConflictChecker, nextJobDB, NukeNS, NukePage, Orphans, OrphanStats, PatchSql, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, PopulateParentId, PopulateSha1, Protect, PurgeList, PurgeOldText, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RefreshImageCount, RefreshLinks, RemoveUnusedAccounts, RenameDbPrefix, RenameWiki, RollbackEdits, RunJobs, ShowJobs, ShowStats, SqliteMaintenance, StorageTypeStats, TableCleanup, Undelete, UpdateArticleCount, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, UploadDumper, and WaitForSlave.

List of all members.

Public Member Functions

 __construct ()
 Default constructor.
 execute ()
 Do the actual work.
 getName ()
 Get the script's name.
 outputChanneled ($msg, $channel=null)
 Message outputter with channeled message support.
 getDbType ()
 Does the script need different DB access? By default, we give Maintenance scripts normal rights to the DB.
 setup ()
 Do some sanity checking and basic setup.
 memoryLimit ()
 Normally we disable the memory_limit when running admin scripts.
 clearParamsAndArgs ()
 Clear all params and arguments.
 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.
 finalSetup ()
 Handle some last-minute setup here.
 globals ()
 Potentially debug globals.
 loadWikimediaSettings ()
 Do setup specific to WMF.
 loadSettings ()
 Generic setup for most installs.

Static Public Member Functions

static getMaintenanceScripts ()
 Get the list of available maintenance scripts.

Public Attributes

const DB_NONE = 0
 Constants for DB access type.
const DB_STD = 1
const DB_ADMIN = 2
const STDIN_ALL = 'all'

Protected Member Functions

 addOption ($name, $description, $required=false, $withArg=false)
 Add a parameter to the script.
 hasOption ($name)
 Checks to see if a particular param exists.
 getOption ($name, $default=null)
 Get an option, or return the default.
 addArg ($arg, $description, $required=true)
 Add some args that are needed.
 hasArg ($argId=0)
 Does a given argument exist?
 getArg ($argId=0, $default=null)
 Get an argument.
 setBatchSize ($s=0)
 Set the batch size.
 getStdin ($len=null)
 Return input from stdin.
 output ($out, $channel=null)
 Throw some output to the user.
 error ($err, $die=false)
 Throw an error to the user.
 addDefaultParams ()
 Add the default parameters to the scripts.
 runChild ($maintClass, $classFile=null)
 Run a child maintenance script.
 validateParamsAndArgs ()
 Run some validation checks on the params, etc.
 loadSpecialVars ()
 Handle the special variables that are global to all scripts.
 maybeHelp ($force=false)
 Maybe show the help.
 purgeRedundantText ($delete=true)
 Support function for cleaning up redundant text records.
 getDir ()
 Get the maintenance directory.

Static Protected Member Functions

static disableSetup ()
 Disable Setup.php mostly.
static getCoreScripts ()
 Return all of the core maintenance scripts.

Protected Attributes

 $mParams = array()
 $mArgList = array()
 $mOptions = array()
 $mArgs = array()
 $mSelf
 $mQuiet = false
 $mDbUser
 $mDbPass
 $mDescription = ''
 $mInputLoaded = false
 $mBatchSize = null

Static Protected Attributes

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

Private Attributes

 $atLineStart = true
 $lastChannel = null


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.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Author:
Chad Horohoe <chad@anyonecanedit.org>
Since:
1.16

Definition at line 46 of file Maintenance.php.


Constructor & Destructor Documentation

Maintenance::__construct (  ) 

Default constructor.

Children should call this if implementing their own constructors

Reimplemented in AddWiki, AttachLatest, BenchmarkPurge, ChangePassword, CheckAutoLoader, CheckBadRedirects, CheckImages, CheckSyntax, CheckUsernames, CapsCleanup, ImageCleanup, CleanupSpam, TableCleanup, TitleCleanup, WatchlistCleanup, ClearInterwikiCache, clear_stats, CommandLineInc, ConvertLinks, ConvertUserOptions, CreateAndPromote, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteBatch, DeleteDefaultMessages, DeleteImageCache, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteRevision, DeleteSelfExternals, DumpLinks, DumpSisterSites, UploadDumper, EditCLI, FetchText, FindHooks, FixSlaveDesync, FixTimestamps, FixUserRegistration, GenerateSitemap, GetLagTimes, GetSlaveServer, GetTextMaint, HttpSessionDownload, InitEditCount, InitStats, DatabaseLag, AllTrans, CountMessages, DateFormats, Digit2Html, DumpMessages, GenerateNormalizerData, Lang2Po, LangMemUsage, mcTest, MergeMessageFileList, MigrateUserGroup, MinifyScript, MoveBatch, NamespaceConflictChecker, nextJobDB, NukeNS, NukePage, Orphans, PatchSql, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, PopulateParentId, PopulateSha1, Protect, PurgeList, PurgeOldText, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RefreshImageCount, RefreshLinks, RemoveUnusedAccounts, RenameDbPrefix, RenameWiki, DumpRenderer, RollbackEdits, BatchedQueryRunner, RunJobs, ShowJobs, ShowStats, MwSql, SqliteMaintenance, CacheStats, DumpRev, FixBug20757, OrphanStats, Undelete, UpdateArticleCount, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, and WaitForSlave.

Definition at line 99 of file Maintenance.php.

References addDefaultParams().


Member Function Documentation

Maintenance::addArg ( arg,
description,
required = true 
) [protected]

Maintenance::addDefaultParams (  )  [protected]

Add the default parameters to the scripts.

Definition at line 309 of file Maintenance.php.

References addOption(), and getDbType().

Referenced by __construct().

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

Add a parameter to the script.

Will be displayed on --help with the associated description

Parameters:
$name String The name of the param (help, version, etc)
$description String The description of the param to show on --help
$required boolean Is the param required?
$withArg Boolean Is an argument required with this option?

Definition at line 118 of file Maintenance.php.

References $name.

Referenced by UpdateSpecialPages::__construct(), UpdateSearchIndex::__construct(), UpdateArticleCount::__construct(), Undelete::__construct(), FixBug20757::__construct(), SqliteMaintenance::__construct(), ShowJobs::__construct(), RunJobs::__construct(), BatchedQueryRunner::__construct(), RollbackEdits::__construct(), DumpRenderer::__construct(), RenameDbPrefix::__construct(), RemoveUnusedAccounts::__construct(), RefreshLinks::__construct(), RebuildLocalisationCache::__construct(), ReassignEdits::__construct(), PurgeOldText::__construct(), Protect::__construct(), PopulateSha1::__construct(), Orphans::__construct(), NukePage::__construct(), NukeNS::__construct(), nextJobDB::__construct(), NamespaceConflictChecker::__construct(), MoveBatch::__construct(), MinifyScript::__construct(), MergeMessageFileList::__construct(), mcTest::__construct(), Lang2Po::__construct(), GenerateNormalizerData::__construct(), DatabaseLag::__construct(), InitStats::__construct(), InitEditCount::__construct(), HttpSessionDownload::__construct(), GetTextMaint::__construct(), GetSlaveServer::__construct(), GenerateSitemap::__construct(), FindHooks::__construct(), EditCLI::__construct(), UploadDumper::__construct(), DeleteOrphanedRevisions::__construct(), DeleteOldRevisions::__construct(), DeleteImageCache::__construct(), DeleteBatch::__construct(), DeleteArchivedRevisions::__construct(), DeleteArchivedFiles::__construct(), CreateAndPromote::__construct(), CommandLineInc::__construct(), WatchlistCleanup::__construct(), TableCleanup::__construct(), CleanupSpam::__construct(), CapsCleanup::__construct(), CheckSyntax::__construct(), ChangePassword::__construct(), BenchmarkPurge::__construct(), AttachLatest::__construct(), and addDefaultParams().

Maintenance::clearParamsAndArgs (  ) 

Clear all params and arguments.

Definition at line 436 of file Maintenance.php.

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

Disable Setup.php mostly.

Definition at line 360 of file Maintenance.php.

Referenced by getCoreScripts(), and runChild().

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

Throw an error to the user.

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

Parameters:
$err String The error to display
$die boolean If true, go ahead and die out.

Definition at line 241 of file Maintenance.php.

References outputChanneled().

Referenced by SqliteMaintenance::backup(), CheckSyntax::buildFileList(), ImageCleanup::buildSafeTitle(), CleanupSpam::cleanupArticle(), UpdateSpecialPages::execute(), UpdateRestrictions::execute(), Undelete::execute(), OrphanStats::execute(), DumpRev::execute(), CacheStats::execute(), SqliteMaintenance::execute(), MwSql::execute(), RunJobs::execute(), BatchedQueryRunner::execute(), RollbackEdits::execute(), RenameDbPrefix::execute(), RemoveUnusedAccounts::execute(), RebuildTextIndex::execute(), RebuildFileCache::execute(), ReassignEdits::execute(), Protect::execute(), PopulateSha1::execute(), PopulateParentId::execute(), PopulateLogSearch::execute(), PatchSql::execute(), MoveBatch::execute(), MinifyScript::execute(), MigrateUserGroup::execute(), MergeMessageFileList::execute(), LangMemUsage::execute(), Lang2Po::execute(), GenerateNormalizerData::execute(), Digit2Html::execute(), GetTextMaint::execute(), GetLagTimes::execute(), FixTimestamps::execute(), EditCLI::execute(), DeleteRevision::execute(), DeleteBatch::execute(), CreateAndPromote::execute(), CleanupSpam::execute(), CapsCleanup::execute(), CheckUsernames::execute(), ChangePassword::execute(), BenchmarkPurge::execute(), AddWiki::execute(), GenerateNormalizerData::generateArabic(), MinifyScript::getExtension(), DumpRenderer::handleRevision(), SqliteMaintenance::integrityCheck(), loadParamsAndArgs(), loadSettings(), MinifyScript::minify(), TitleCleanup::moveInconsistentPage(), ImageCleanup::pokeFile(), runChild(), setup(), SqliteMaintenance::vacuum(), and validateParamsAndArgs().

Maintenance::execute (  )  [abstract]

Do the actual work.

All child classes will need to implement this

Reimplemented in AddWiki, AttachLatest, BenchmarkPurge, ChangePassword, CheckAutoLoader, CheckBadRedirects, CheckImages, CheckSyntax, CheckUsernames, CapsCleanup, CleanupSpam, TableCleanup, WatchlistCleanup, ClearInterwikiCache, clear_stats, CommandLineInc, ConvertLinks, ConvertUserOptions, CreateAndPromote, DeleteArchivedFiles, DeleteArchivedRevisions, DeleteBatch, DeleteDefaultMessages, DeleteImageCache, DeleteOldRevisions, DeleteOrphanedRevisions, DeleteRevision, DeleteSelfExternals, DumpLinks, DumpSisterSites, UploadDumper, EditCLI, FetchText, FindHooks, FixSlaveDesync, FixTimestamps, FixUserRegistration, GenerateSitemap, GetLagTimes, GetSlaveServer, GetTextMaint, HttpSessionDownload, InitEditCount, InitStats, DatabaseLag, AllTrans, CountMessages, DateFormats, Digit2Html, DumpMessages, GenerateNormalizerData, Lang2Po, LangMemUsage, mcTest, MergeMessageFileList, MigrateUserGroup, MinifyScript, MoveBatch, NamespaceConflictChecker, nextJobDB, NukeNS, NukePage, Orphans, PatchSql, PopulateCategory, PopulateLogSearch, PopulateLogUsertext, PopulateParentId, PopulateSha1, Protect, PurgeList, PurgeOldText, ReassignEdits, RebuildAll, RebuildFileCache, RebuildLocalisationCache, RebuildMessages, RebuildRecentchanges, RebuildTextIndex, RefreshImageCount, RefreshLinks, RemoveUnusedAccounts, RenameDbPrefix, RenameWiki, DumpRenderer, RollbackEdits, BatchedQueryRunner, RunJobs, ShowJobs, ShowStats, MwSql, SqliteMaintenance, CacheStats, DumpRev, FixBug20757, OrphanStats, StorageTypeStats, Undelete, UpdateArticleCount, UpdateRestrictions, UpdateSearchIndex, UpdateSpecialPages, and WaitForSlave.

Maintenance::finalSetup (  ) 

Maintenance::getArg ( argId = 0,
default = null 
) [protected]

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

Return all of the core maintenance scripts.

Returns:
array

Definition at line 837 of file Maintenance.php.

References disableSetup().

Referenced by getMaintenanceScripts().

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:
int

Reimplemented in AddWiki, CheckSyntax, CommandLineInc, FindHooks, PatchSql, RebuildTextIndex, RenameDbPrefix, RenameWiki, BatchedQueryRunner, MwSql, SqliteMaintenance, and UpdateSearchIndex.

Definition at line 302 of file Maintenance.php.

References DB_STD.

Referenced by addDefaultParams(), and finalSetup().

Maintenance::getDir (  )  [protected]

Get the maintenance directory.

Definition at line 818 of file Maintenance.php.

Referenced by RenameWiki::execute(), and AddWiki::execute().

static Maintenance::getMaintenanceScripts (  )  [static]

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

References $wgMaintenanceScripts, and getCoreScripts().

Maintenance::getName (  ) 

Get the script's name.

Returns:
String

Definition at line 192 of file Maintenance.php.

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

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

Return input from stdin.

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

Definition at line 203 of file Maintenance.php.

References $input, and STDIN_ALL.

Referenced by MwSql::execute(), DumpRenderer::execute(), PurgeList::execute(), MoveBatch::execute(), FetchText::execute(), EditCLI::execute(), and DeleteBatch::execute().

Maintenance::globals (  ) 

Potentially debug globals.

Originally a feature only for refreshLinks

Definition at line 672 of file Maintenance.php.

References hasOption().

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

Does a given argument exist?

Parameters:
$argId int The integer value (from zero) for the arg
Returns:
boolean

Definition at line 166 of file Maintenance.php.

Referenced by MwSql::execute(), BatchedQueryRunner::execute(), RebuildFileCache::execute(), ReassignEdits::execute(), MoveBatch::execute(), mcTest::execute(), FixSlaveDesync::execute(), DeleteBatch::execute(), getArg(), and validateParamsAndArgs().

Maintenance::hasOption ( name  )  [protected]

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:
$self String The name of the script, if any
$opts Array An array of options, in form of key=>value
$args Array An array of command line arguments

Definition at line 451 of file Maintenance.php.

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

Referenced by setup().

Maintenance::loadSettings (  ) 

Generic setup for most installs.

Returns the location of LocalSettings

Returns:
String

Definition at line 732 of file Maintenance.php.

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

Maintenance::loadSpecialVars (  )  [protected]

Handle the special variables that are global to all scripts.

Definition at line 562 of file Maintenance.php.

References getOption(), and hasOption().

Referenced by loadParamsAndArgs().

Maintenance::loadWikimediaSettings (  ) 

Do setup specific to WMF.

Definition at line 681 of file Maintenance.php.

References $IP, and $wgUseNormalUser.

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

Maybe show the help.

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

Reimplemented in CommandLineInc.

Definition at line 577 of file Maintenance.php.

References $output, hasOption(), and output().

Referenced by loadParamsAndArgs(), setup(), and validateParamsAndArgs().

Maintenance::memoryLimit (  ) 

Normally we disable the memory_limit when running admin scripts.

Some scripts may wish to actually set a limit, however, to avoid blowing up unexpectedly.

Reimplemented in RebuildLocalisationCache, and RunJobs.

Definition at line 429 of file Maintenance.php.

Referenced by finalSetup(), and setup().

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:
$out String The text to show to the user
$channel Mixed Unique identifier for the channel. See function outputChanneled.

Definition at line 220 of file Maintenance.php.

References $out, and outputChanneled().

Referenced by SqliteMaintenance::backup(), CheckSyntax::buildFileList(), CheckSyntax::checkFileWithCli(), CheckSyntax::checkFileWithParsekit(), Orphans::checkOrphans(), NamespaceConflictChecker::checkPrefix(), CheckSyntax::checkRegex(), Orphans::checkSeparation(), Orphans::checkWidows(), CleanupSpam::cleanupArticle(), RebuildTextIndex::clearSearchIndex(), RebuildTextIndex::createMysqlTextIndex(), ConvertLinks::createTempTable(), RefreshLinks::deleteLinksFromNonexistent(), FixSlaveDesync::desyncFixPage(), DeleteOldRevisions::doDelete(), PopulateCategory::doPopulateCategory(), ReassignEdits::doReassignEdits(), RebuildLocalisationCache::doRebuild(), RefreshLinks::doRefreshLinks(), UpdateSearchIndex::doUpdateSearchIndex(), RebuildTextIndex::dropMysqlTextIndex(), UpdateSpecialPages::execute(), UpdateRestrictions::execute(), UpdateArticleCount::execute(), Undelete::execute(), OrphanStats::execute(), DumpRev::execute(), CacheStats::execute(), ShowStats::execute(), ShowJobs::execute(), BatchedQueryRunner::execute(), RollbackEdits::execute(), RenameWiki::execute(), RenameDbPrefix::execute(), RemoveUnusedAccounts::execute(), RefreshImageCount::execute(), RebuildTextIndex::execute(), RebuildRecentchanges::execute(), RebuildMessages::execute(), RebuildLocalisationCache::execute(), RebuildFileCache::execute(), RebuildAll::execute(), ReassignEdits::execute(), PurgeList::execute(), Protect::execute(), PopulateSha1::execute(), PopulateParentId::execute(), PopulateLogUsertext::execute(), PopulateLogSearch::execute(), PatchSql::execute(), NukePage::execute(), NukeNS::execute(), nextJobDB::execute(), NamespaceConflictChecker::execute(), MoveBatch::execute(), MigrateUserGroup::execute(), mcTest::execute(), LangMemUsage::execute(), Lang2Po::execute(), DumpMessages::execute(), Digit2Html::execute(), DateFormats::execute(), CountMessages::execute(), AllTrans::execute(), DatabaseLag::execute(), InitStats::execute(), InitEditCount::execute(), GetTextMaint::execute(), GetSlaveServer::execute(), GetLagTimes::execute(), FixUserRegistration::execute(), FixTimestamps::execute(), FindHooks::execute(), FetchText::execute(), EditCLI::execute(), DumpSisterSites::execute(), DumpLinks::execute(), DeleteSelfExternals::execute(), DeleteRevision::execute(), DeleteOrphanedRevisions::execute(), DeleteOldRevisions::execute(), DeleteImageCache::execute(), DeleteBatch::execute(), DeleteArchivedRevisions::execute(), DeleteArchivedFiles::execute(), CreateAndPromote::execute(), ConvertUserOptions::execute(), ConvertLinks::execute(), ClearInterwikiCache::execute(), WatchlistCleanup::execute(), TableCleanup::execute(), CleanupSpam::execute(), CheckSyntax::execute(), CheckImages::execute(), CheckBadRedirects::execute(), CheckAutoLoader::execute(), ChangePassword::execute(), BenchmarkPurge::execute(), AttachLatest::execute(), AddWiki::execute(), FixSlaveDesync::findPageLatestCorruption(), DumpRenderer::handleRevision(), SqliteMaintenance::integrityCheck(), ImageCleanup::killRow(), GenerateSitemap::main(), maybeHelp(), TitleCleanup::moveIllegalPage(), TitleCleanup::moveInconsistentPage(), UploadDumper::outputItem(), ImageCleanup::pokeFile(), RebuildTextIndex::populateSearchIndex(), FindHooks::printArray(), WatchlistCleanup::processRow(), TitleCleanup::processRow(), ImageCleanup::processRow(), CapsCleanup::processRow(), TableCleanup::progress(), RebuildRecentchanges::purgeFeeds(), purgeRedundantText(), RebuildRecentchanges::rebuildRecentChangesTablePass1(), RebuildRecentchanges::rebuildRecentChangesTablePass2(), RebuildRecentchanges::rebuildRecentChangesTablePass3(), RebuildRecentchanges::rebuildRecentChangesTablePass4(), WatchlistCleanup::removeWatch(), NamespaceConflictChecker::reportConflict(), NamespaceConflictChecker::resolveConflict(), NamespaceConflictChecker::resolveConflictOn(), RunJobs::runJobsLog(), TableCleanup::runTable(), MwSql::sqlPrintResult(), 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:
$msg String The message without trailing newline
$channel Channel identifier or null for no channel. Channel comparison uses ===.

Definition at line 263 of file Maintenance.php.

References $msg.

Referenced by error(), and output().

Maintenance::purgeRedundantText ( delete = true  )  [protected]

Support function for cleaning up redundant text records.

Parameters:
$delete boolean Whether or not to actually delete the records
Author:
Rob Church <robchur@gmail.com>

Definition at line 764 of file Maintenance.php.

References $dbw, $res, output(), and wfGetDB().

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

Maintenance::runChild ( maintClass,
classFile = null 
) [protected]

Run a child maintenance script.

Pass all of the current arguments to it.

Parameters:
$maintClass String A name of a child maintenance class
$classFile String Full path of where the child is
Returns:
Maintenance child

Definition at line 337 of file Maintenance.php.

References $maintClass, disableSetup(), and error().

Referenced by RebuildAll::execute(), and NukeNS::execute().

Maintenance::setBatchSize ( s = 0  )  [protected]

Set the batch size.

Parameters:
$s int The number of operations to do in a batch

Definition at line 184 of file Maintenance.php.

References $s.

Referenced by UpdateRestrictions::__construct(), RefreshLinks::__construct(), RebuildFileCache::__construct(), PopulateParentId::__construct(), PopulateLogUsertext::__construct(), MigrateUserGroup::__construct(), and CheckImages::__construct().

Maintenance::setup (  ) 

Do some sanity checking and basic setup.

Definition at line 368 of file Maintenance.php.

References $IP, $wgCommandLineMode, $wgRequestTime, error(), loadParamsAndArgs(), maybeHelp(), memoryLimit(), and validateParamsAndArgs().

Maintenance::validateParamsAndArgs (  )  [protected]

Run some validation checks on the params, etc.

Definition at line 539 of file Maintenance.php.

References error(), hasArg(), hasOption(), and maybeHelp().

Referenced by setup().


Member Data Documentation

Maintenance::$atLineStart = true [private]

Definition at line 253 of file Maintenance.php.

Maintenance::$lastChannel = null [private]

Definition at line 254 of file Maintenance.php.

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

Definition at line 63 of file Maintenance.php.

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

Definition at line 69 of file Maintenance.php.

Maintenance::$mBatchSize = null [protected]

Definition at line 86 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 93 of file Maintenance.php.

Maintenance::$mDbPass [protected]

Definition at line 76 of file Maintenance.php.

Maintenance::$mDbUser [protected]

Definition at line 76 of file Maintenance.php.

Maintenance::$mDescription = '' [protected]

Definition at line 79 of file Maintenance.php.

Maintenance::$mInputLoaded = false [protected]

Definition at line 82 of file Maintenance.php.

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

Definition at line 66 of file Maintenance.php.

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

Definition at line 60 of file Maintenance.php.

Maintenance::$mQuiet = false [protected]

Definition at line 75 of file Maintenance.php.

Maintenance::$mSelf [protected]

Definition at line 72 of file Maintenance.php.

Constants for DB access type.

See also:
Maintenance::getDbType()

Definition at line 52 of file Maintenance.php.

Referenced by SqliteMaintenance::getDbType(), FindHooks::getDbType(), and CheckSyntax::getDbType().

Definition at line 53 of file Maintenance.php.

Referenced by getDbType(), and CommandLineInc::getDbType().

const Maintenance::STDIN_ALL = 'all'

Definition at line 57 of file Maintenance.php.

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


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

Generated on Sat Apr 30 22:57:43 2011 for MediaWiki by  doxygen 1.5.9