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.
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 |
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
Definition at line 46 of file Maintenance.php.
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().
Maintenance::addArg | ( | $ | arg, | |
$ | description, | |||
$ | required = true | |||
) | [protected] |
Add some args that are needed.
$arg | String Name of the arg, like 'start' | |
$description | String Short description of the arg | |
$required | Boolean Is this required? |
Definition at line 153 of file Maintenance.php.
Referenced by WaitForSlave::__construct(), Undelete::__construct(), DumpRev::__construct(), RenameWiki::__construct(), RefreshLinks::__construct(), RebuildFileCache::__construct(), ReassignEdits::__construct(), PatchSql::__construct(), NukePage::__construct(), MoveBatch::__construct(), MigrateUserGroup::__construct(), mcTest::__construct(), GetTextMaint::__construct(), FixTimestamps::__construct(), EditCLI::__construct(), DeleteBatch::__construct(), CreateAndPromote::__construct(), CleanupSpam::__construct(), and AddWiki::__construct().
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
$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 | ( | ) |
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
$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 | ( | ) |
Handle some last-minute setup here.
Definition at line 617 of file Maintenance.php.
References $i, $IP, $wgCommandLineMode, $wgDBadminpassword, $wgDBadminuser, $wgDBpassword, $wgDBservers, $wgDBuser, $wgLBFactoryConf, $wgProfiling, $wgServer, $wgShowSQLErrors, $wgTitle, getDbType(), getOption(), hasOption(), and memoryLimit().
Maintenance::getArg | ( | $ | argId = 0 , |
|
$ | default = null | |||
) | [protected] |
Get an argument.
$argId | int The integer value (from zero) for the arg | |
$default | mixed The default if it doesn't exist |
Definition at line 176 of file Maintenance.php.
References hasArg().
Referenced by WaitForSlave::execute(), Undelete::execute(), DumpRev::execute(), MwSql::execute(), BatchedQueryRunner::execute(), RenameWiki::execute(), RefreshLinks::execute(), RebuildFileCache::execute(), ReassignEdits::execute(), Protect::execute(), NukePage::execute(), MoveBatch::execute(), MinifyScript::execute(), MigrateUserGroup::execute(), mcTest::execute(), CountMessages::execute(), GetTextMaint::execute(), FixTimestamps::execute(), FixSlaveDesync::execute(), EditCLI::execute(), DeleteBatch::execute(), CreateAndPromote::execute(), CleanupSpam::execute(), and AddWiki::execute().
static Maintenance::getCoreScripts | ( | ) | [static, protected] |
Return all of the core maintenance scripts.
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
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
Definition at line 828 of file Maintenance.php.
References $wgMaintenanceScripts, and getCoreScripts().
Maintenance::getName | ( | ) |
Maintenance::getOption | ( | $ | name, | |
$ | default = null | |||
) | [protected] |
Get an option, or return the default.
$name | String The name of the param | |
$default | mixed Anything you want, default null |
Definition at line 137 of file Maintenance.php.
References $name, and hasOption().
Referenced by CheckSyntax::buildFileList(), UpdateSpecialPages::execute(), UpdateSearchIndex::execute(), Undelete::execute(), FixBug20757::execute(), SqliteMaintenance::execute(), RunJobs::execute(), BatchedQueryRunner::execute(), RollbackEdits::execute(), DumpRenderer::execute(), RenameDbPrefix::execute(), RemoveUnusedAccounts::execute(), RefreshLinks::execute(), RebuildLocalisationCache::execute(), Protect::execute(), PopulateSha1::execute(), PopulateCategory::execute(), NukePage::execute(), NukeNS::execute(), nextJobDB::execute(), NamespaceConflictChecker::execute(), MoveBatch::execute(), MinifyScript::execute(), MergeMessageFileList::execute(), mcTest::execute(), Lang2Po::execute(), GenerateNormalizerData::execute(), HttpSessionDownload::execute(), GetSlaveServer::execute(), GenerateSitemap::execute(), EditCLI::execute(), UploadDumper::execute(), DeleteImageCache::execute(), DeleteBatch::execute(), ChangePassword::execute(), BenchmarkPurge::execute(), finalSetup(), and loadSpecialVars().
Maintenance::getStdin | ( | $ | len = null |
) | [protected] |
Return input from stdin.
$length | int The number of bytes to read. If null, just return the handle. Maintenance::STDIN_ALL returns the full length |
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?
$argId | int The integer value (from zero) for the arg |
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] |
Checks to see if a particular param exists.
$name | String The name of the param |
Definition at line 127 of file Maintenance.php.
References $name.
Referenced by CheckSyntax::buildFileList(), UpdateSpecialPages::execute(), UpdateSearchIndex::execute(), UpdateArticleCount::execute(), SqliteMaintenance::execute(), ShowJobs::execute(), RunJobs::execute(), RollbackEdits::execute(), RemoveUnusedAccounts::execute(), RefreshLinks::execute(), RebuildLocalisationCache::execute(), ReassignEdits::execute(), PurgeOldText::execute(), Protect::execute(), Orphans::execute(), NamespaceConflictChecker::execute(), MinifyScript::execute(), MergeMessageFileList::execute(), GenerateNormalizerData::execute(), DatabaseLag::execute(), InitStats::execute(), InitEditCount::execute(), GetTextMaint::execute(), GetSlaveServer::execute(), EditCLI::execute(), UploadDumper::execute(), DeleteOrphanedRevisions::execute(), DeleteOldRevisions::execute(), DeleteArchivedRevisions::execute(), DeleteArchivedFiles::execute(), CreateAndPromote::execute(), WatchlistCleanup::execute(), TableCleanup::execute(), CleanupSpam::execute(), CapsCleanup::execute(), CheckSyntax::execute(), BenchmarkPurge::execute(), AttachLatest::execute(), finalSetup(), FindHooks::getHooksFromDoc(), getOption(), globals(), loadSpecialVars(), maybeHelp(), WatchlistCleanup::removeWatch(), and validateParamsAndArgs().
Maintenance::loadParamsAndArgs | ( | $ | self = null , |
|
$ | opts = null , |
|||
$ | args = null | |||
) |
Process command line arguments $mOptions becomes an array with keys set to the option names $mArgs becomes a zero-based array containing the non-option arguments.
$self | String The name of the script, if any | |
$opts | Array An array of options, in form of key=>value | |
$args | Array An array of command line arguments |
Definition at line 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
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.
$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
$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.
$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.
Maintenance::purgeRedundantText | ( | $ | delete = true |
) | [protected] |
Support function for cleaning up redundant text records.
$delete | boolean Whether or not to actually delete the records |
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.
$maintClass | String A name of a child maintenance class | |
$classFile | String Full path of where the child is |
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.
$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().
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.
const Maintenance::DB_ADMIN = 2 |
Definition at line 54 of file Maintenance.php.
Referenced by UpdateSearchIndex::getDbType(), MwSql::getDbType(), BatchedQueryRunner::getDbType(), RenameWiki::getDbType(), RenameDbPrefix::getDbType(), RebuildTextIndex::getDbType(), PatchSql::getDbType(), CommandLineInc::getDbType(), and AddWiki::getDbType().
const Maintenance::DB_NONE = 0 |
Constants for DB access type.
Definition at line 52 of file Maintenance.php.
Referenced by SqliteMaintenance::getDbType(), FindHooks::getDbType(), and CheckSyntax::getDbType().
const Maintenance::DB_STD = 1 |
Definition at line 53 of file Maintenance.php.
Referenced by getDbType(), and CommandLineInc::getDbType().
const Maintenance::STDIN_ALL = 'all' |