Go to the documentation of this file.
24 if ( !function_exists(
'version_compare' ) || version_compare( PHP_VERSION,
'5.3.2' ) < 0 ) {
26 require_once dirname( __FILE__ ) .
'/../includes/PHPVersionError.php';
36 define(
'RUN_MAINTENANCE_IF_MAIN', __DIR__ .
'/doMaintenance.php' );
124 $IP = strval( getenv(
'MW_INSTALL_PATH' ) ) !==
''
125 ? getenv(
'MW_INSTALL_PATH' )
126 : realpath( __DIR__ .
'/..' );
129 register_shutdown_function(
array( $this,
'outputChanneled' ),
false );
140 $bt = debug_backtrace();
145 if ( $bt[0][
'class'] !==
'Maintenance' || $bt[0][
'function'] !==
'shouldExecute' ) {
148 $includeFuncs =
array(
'require_once',
'require',
'include',
'include_once' );
149 for ( $i = 1; $i <
$count; $i++ ) {
150 if ( !in_array( $bt[$i][
'function'], $includeFuncs ) ) {
160 abstract public function execute();
172 protected function addOption(
$name, $description, $required =
false, $withArg =
false, $shortName =
false ) {
173 $this->mParams[
$name] =
array(
'desc' => $description,
'require' => $required,
'withArg' => $withArg,
'shortName' => $shortName );
174 if ( $shortName !==
false ) {
175 $this->mShortParamsMap[$shortName] =
$name;
185 return isset( $this->mOptions[
$name] );
196 return $this->mOptions[
$name];
199 $this->mOptions[
$name] = $default;
200 return $this->mOptions[
$name];
210 protected function addArg( $arg, $description, $required =
true ) {
211 $this->mArgList[] =
array(
213 'desc' => $description,
214 'require' => $required
223 unset( $this->mParams[
$name] );
231 $this->mDescription = $text;
239 protected function hasArg( $argId = 0 ) {
240 return isset( $this->mArgs[$argId] );
249 protected function getArg( $argId = 0, $default =
null ) {
250 return $this->
hasArg( $argId ) ? $this->mArgs[$argId] : $default;
258 $this->mBatchSize =
$s;
265 if ( $this->mBatchSize ) {
266 $this->
addOption(
'batch-size',
'Run this many operations ' .
267 'per batch, default: ' . $this->mBatchSize,
false,
true );
268 if ( isset( $this->mParams[
'batch-size'] ) ) {
270 $this->mDependantParameters[
'batch-size'] = $this->mParams[
'batch-size'];
290 protected function getStdin( $len =
null ) {
292 return file_get_contents(
'php://stdin' );
294 $f = fopen(
'php://stdin',
'rt' );
298 $input = fgets(
$f, $len );
300 return rtrim( $input );
317 protected function output(
$out, $channel =
null ) {
318 if ( $this->mQuiet ) {
321 if ( $channel ===
null ) {
325 $out = preg_replace(
'/\n\z/',
'',
$out );
336 protected function error( $err, $die = 0 ) {
338 if ( PHP_SAPI ==
'cli' ) {
339 fwrite( STDERR, $err .
"\n" );
343 $die = intval( $die );
356 if ( !$this->atLineStart ) {
358 $this->atLineStart =
true;
371 if ( $msg ===
false ) {
377 if ( !$this->atLineStart && $channel !== $this->lastChannel ) {
383 $this->atLineStart =
false;
384 if ( $channel ===
null ) {
387 $this->atLineStart =
true;
389 $this->lastChannel = $channel;
411 # Generic (non script dependant) options:
413 $this->
addOption(
'help',
'Display this help message',
false,
false,
'h' );
414 $this->
addOption(
'quiet',
'Whether to supress non-error output',
false,
false,
'q' );
415 $this->
addOption(
'conf',
'Location of LocalSettings.php, if not default',
false,
true );
416 $this->
addOption(
'wiki',
'For specifying the wiki ID',
false,
true );
417 $this->
addOption(
'globals',
'Output globals at the end of processing for debugging' );
418 $this->
addOption(
'memory-limit',
'Set a specific memory limit for the script, "max" for no limit or "default" to avoid changing it' );
419 $this->
addOption(
'server',
"The protocol and server name to use in URLs, e.g. " .
420 "http://en.wikipedia.org. This is sometimes necessary because " .
421 "server name detection may fail in command line scripts.",
false,
true );
422 $this->
addOption(
'profiler',
'Set to "text" or "trace" to show profiling output',
false,
true );
424 # Save generic options to display them separately in help
427 # Script dependant options:
431 $this->
addOption(
'dbuser',
'The DB user to use for this script',
false,
true );
432 $this->
addOption(
'dbpass',
'The password to use for this script',
false,
true );
435 # Save additional script dependant options to display
436 # them separately in help
437 $this->mDependantParameters = array_diff_key( $this->mParams, $this->mGenericParameters );
451 require_once $classFile;
454 $this->
error(
"Cannot spawn child: $maintClass" );
462 $child->loadParamsAndArgs( $this->mSelf, $this->mOptions, $this->mArgs );
463 if ( !is_null( $this->mDb ) ) {
464 $child->setDB( $this->mDb );
472 public function setup() {
475 # Abort if called from a web server
476 if ( isset( $_SERVER ) && isset( $_SERVER[
'REQUEST_METHOD'] ) ) {
477 $this->
error(
'This script must be run from the command line',
true );
480 if ( $IP ===
null ) {
481 $this->
error(
"\$IP not set, aborting!\n" .
482 '(Did you forget to call parent::__construct() in your maintenance script?)', 1 );
485 # Make sure we can handle script parameters
486 if ( !defined(
'HPHP_VERSION' ) && !ini_get(
'register_argc_argv' ) ) {
487 $this->
error(
'Cannot get command line arguments, register_argc_argv is set to false',
true );
493 if ( ini_get(
'display_errors' ) ) {
494 ini_set(
'display_errors',
'stderr' );
500 # Set the memory limit
501 # Note we need to set it again later in cache LocalSettings changed it
504 # Set max execution time to 0 (no limit). PHP.net says that
505 # "When running PHP from the command line the default setting is 0."
506 # But sometimes this doesn't seem to be the case.
507 ini_set(
'max_execution_time', 0 );
511 # Define us as being in MediaWiki
512 define(
'MEDIAWIKI',
true );
516 # Turn off output buffering if it's on
517 while ( ob_get_level() > 0 ) {
547 if (
$limit !=
'default' ) {
548 ini_set(
'memory_limit',
$limit );
556 $this->mOptions =
array();
557 $this->mArgs =
array();
558 $this->mInputLoaded =
false;
571 # If we were given opts or args, set those and return early
573 $this->mSelf =
$self;
574 $this->mInputLoaded =
true;
577 $this->mOptions = $opts;
578 $this->mInputLoaded =
true;
581 $this->mArgs =
$args;
582 $this->mInputLoaded =
true;
585 # If we've already loaded input (either by user values or from $argv)
586 # skip on loading it again. The array_shift() will corrupt values if
587 # it's run again and again
588 if ( $this->mInputLoaded ) {
594 $this->mSelf = array_shift( $argv );
600 for ( $arg = reset( $argv ); $arg !==
false; $arg = next( $argv ) ) {
601 if ( $arg ==
'--' ) {
602 # End of options, remainder should be considered arguments
603 $arg = next( $argv );
604 while ( $arg !==
false ) {
606 $arg = next( $argv );
609 } elseif ( substr( $arg, 0, 2 ) ==
'--' ) {
611 $option = substr( $arg, 2 );
612 if ( array_key_exists( $option,
$options ) ) {
613 $this->
error(
"\nERROR: $option parameter given twice\n" );
616 if ( isset( $this->mParams[$option] ) && $this->mParams[$option][
'withArg'] ) {
617 $param = next( $argv );
618 if ( $param ===
false ) {
619 $this->
error(
"\nERROR: $option parameter needs a value after it\n" );
624 $bits = explode(
'=', $option, 2 );
625 if ( count( $bits ) > 1 ) {
633 } elseif ( substr( $arg, 0, 1 ) ==
'-' ) {
635 for ( $p = 1; $p < strlen( $arg ); $p++ ) {
636 $option = $arg { $p };
637 if ( !isset( $this->mParams[$option] ) && isset( $this->mShortParamsMap[$option] ) ) {
638 $option = $this->mShortParamsMap[$option];
640 if ( array_key_exists( $option,
$options ) ) {
641 $this->
error(
"\nERROR: $option parameter given twice\n" );
644 if ( isset( $this->mParams[$option][
'withArg'] ) && $this->mParams[$option][
'withArg'] ) {
645 $param = next( $argv );
646 if ( $param ===
false ) {
647 $this->
error(
"\nERROR: $option parameter needs a value after it\n" );
661 $this->mArgs =
$args;
663 $this->mInputLoaded =
true;
671 # Check to make sure we've got all the required options
672 foreach ( $this->mParams
as $opt => $info ) {
673 if ( $info[
'require'] && !$this->
hasOption( $opt ) ) {
674 $this->
error(
"Param $opt required!" );
679 foreach ( $this->mArgList
as $k => $info ) {
680 if ( $info[
'require'] && !$this->
hasArg( $k ) ) {
681 $this->
error(
'Argument <' . $info[
'name'] .
'> required!' );
696 $this->mDbUser = $this->
getOption(
'dbuser' );
699 $this->mDbPass = $this->
getOption(
'dbpass' );
702 $this->mQuiet =
true;
704 if ( $this->
hasOption(
'batch-size' ) ) {
705 $this->mBatchSize = intval( $this->
getOption(
'batch-size' ) );
713 protected function maybeHelp( $force =
false ) {
714 if ( !$force && !$this->
hasOption(
'help' ) ) {
720 $descWidth = $screenWidth - ( 2 * strlen( $tab ) );
722 ksort( $this->mParams );
723 $this->mQuiet =
false;
726 if ( $this->mDescription ) {
727 $this->
output(
"\n" . $this->mDescription .
"\n" );
729 $output =
"\nUsage: php " . basename( $this->mSelf );
732 if ( $this->mParams ) {
733 $output .=
" [--" . implode( array_keys( $this->mParams ),
"|--" ) .
"]";
737 if ( $this->mArgList ) {
739 foreach ( $this->mArgList
as $k => $arg ) {
740 if ( $arg[
'require'] ) {
741 $output .=
'<' . $arg[
'name'] .
'>';
743 $output .=
'[' . $arg[
'name'] .
']';
745 if ( $k < count( $this->mArgList ) - 1 ) {
750 $this->
output(
"$output\n\n" );
752 # TODO abstract some repetitive code below
755 $this->
output(
"Generic maintenance parameters:\n" );
756 foreach ( $this->mGenericParameters
as $par => $info ) {
757 if ( $info[
'shortName'] !==
false ) {
758 $par .=
" (-{$info['shortName']})";
761 wordwrap(
"$tab--$par: " . $info[
'desc'], $descWidth,
762 "\n$tab$tab" ) .
"\n"
768 if ( count( $scriptDependantParams ) > 0 ) {
769 $this->
output(
"Script dependant parameters:\n" );
771 foreach ( $scriptDependantParams
as $par => $info ) {
772 if ( $info[
'shortName'] !==
false ) {
773 $par .=
" (-{$info['shortName']})";
776 wordwrap(
"$tab--$par: " . $info[
'desc'], $descWidth,
777 "\n$tab$tab" ) .
"\n"
785 $scriptSpecificParams = array_diff_key(
786 # all script parameters:
789 $this->mGenericParameters,
790 $this->mDependantParameters
792 if ( count( $scriptSpecificParams ) > 0 ) {
793 $this->
output(
"Script specific parameters:\n" );
795 foreach ( $scriptSpecificParams
as $par => $info ) {
796 if ( $info[
'shortName'] !==
false ) {
797 $par .=
" (-{$info['shortName']})";
800 wordwrap(
"$tab--$par: " . $info[
'desc'], $descWidth,
801 "\n$tab$tab" ) .
"\n"
808 if ( count( $this->mArgList ) > 0 ) {
809 $this->
output(
"Arguments:\n" );
811 foreach ( $this->mArgList
as $info ) {
812 $openChar = $info[
'require'] ?
'<' :
'[';
813 $closeChar = $info[
'require'] ?
'>' :
']';
815 wordwrap(
"$tab$openChar" . $info[
'name'] .
"$closeChar: " .
816 $info[
'desc'], $descWidth,
"\n$tab$tab" ) .
"\n"
830 global $wgDBadminuser, $wgDBadminpassword;
831 global $wgDBuser, $wgDBpassword, $wgDBservers, $wgLBFactoryConf;
833 # Turn off output buffering again, it might have been turned on in the settings files
834 if ( ob_get_level() ) {
842 $wgServer = $this->
getOption(
'server', $wgServer );
845 # If these were passed, use them
846 if ( $this->mDbUser ) {
849 if ( $this->mDbPass ) {
853 if ( $this->
getDbType() == self::DB_ADMIN && isset( $wgDBadminuser ) ) {
854 $wgDBuser = $wgDBadminuser;
855 $wgDBpassword = $wgDBadminpassword;
857 if ( $wgDBservers ) {
861 foreach ( $wgDBservers
as $i => $server ) {
862 $wgDBservers[$i][
'user'] = $wgDBuser;
863 $wgDBservers[$i][
'password'] = $wgDBpassword;
866 if ( isset( $wgLBFactoryConf[
'serverTemplate'] ) ) {
867 $wgLBFactoryConf[
'serverTemplate'][
'user'] = $wgDBuser;
868 $wgLBFactoryConf[
'serverTemplate'][
'password'] = $wgDBpassword;
875 $wgShowSQLErrors =
true;
876 @set_time_limit( 0 );
880 $forcedProfiler = $this->
getOption(
'profiler' );
881 if ( $forcedProfiler ===
'text' ) {
884 } elseif ( $forcedProfiler ===
'trace' ) {
894 if ( defined(
'MW_CMDLINE_CALLBACK' ) ) {
895 call_user_func( MW_CMDLINE_CALLBACK );
916 if ( isset( $this->mOptions[
'conf'] ) ) {
917 $settingsFile = $this->mOptions[
'conf'];
918 } elseif ( defined(
"MW_CONFIG_FILE" ) ) {
919 $settingsFile = MW_CONFIG_FILE;
921 $settingsFile =
"$IP/LocalSettings.php";
923 if ( isset( $this->mOptions[
'wiki'] ) ) {
924 $bits = explode(
'-', $this->mOptions[
'wiki'] );
925 if ( count( $bits ) == 1 ) {
928 define(
'MW_DB', $bits[0] );
929 define(
'MW_PREFIX', $bits[1] );
932 if ( !is_readable( $settingsFile ) ) {
933 $this->
error(
"A copy of your installation's LocalSettings.php\n" .
934 "must exist and be readable in the source directory.\n" .
935 "Use --conf to specify it.",
true );
937 $wgCommandLineMode =
true;
938 return $settingsFile;
947 # Data should come off the master, wrapped in a transaction
949 $dbw->begin( __METHOD__ );
951 # Get "active" text records from the revisions table
952 $this->
output(
'Searching for active text records in revisions table...' );
953 $res = $dbw->select(
'revision',
'rev_text_id',
array(), __METHOD__,
array(
'DISTINCT' ) );
954 foreach (
$res as $row ) {
955 $cur[] = $row->rev_text_id;
957 $this->
output(
"done.\n" );
959 # Get "active" text records from the archive table
960 $this->
output(
'Searching for active text records in archive table...' );
961 $res = $dbw->select(
'archive',
'ar_text_id',
array(), __METHOD__,
array(
'DISTINCT' ) );
962 foreach (
$res as $row ) {
963 # old pre-MW 1.5 records can have null ar_text_id's.
964 if ( $row->ar_text_id !==
null ) {
965 $cur[] = $row->ar_text_id;
968 $this->
output(
"done.\n" );
970 # Get the IDs of all text records not in these sets
971 $this->
output(
'Searching for inactive text records...' );
972 $cond =
'old_id NOT IN ( ' . $dbw->makeList( $cur ) .
' )';
973 $res = $dbw->select(
'text',
'old_id',
array( $cond ), __METHOD__,
array(
'DISTINCT' ) );
975 foreach (
$res as $row ) {
976 $old[] = $row->old_id;
978 $this->
output(
"done.\n" );
980 # Inform the user of what we're going to do
981 $count = count( $old );
982 $this->
output(
"$count inactive items found.\n" );
984 # Delete as appropriate
985 if ( $delete &&
$count ) {
986 $this->
output(
'Deleting...' );
987 $dbw->delete(
'text',
array(
'old_id' => $old ), __METHOD__ );
988 $this->
output(
"done.\n" );
992 $dbw->commit( __METHOD__ );
999 protected function getDir() {
1010 protected function &
getDB( $db, $groups =
array(), $wiki =
false ) {
1011 if ( is_null( $this->mDb ) ) {
1012 return wfGetDB( $db, $groups, $wiki );
1023 public function setDB( &$db ) {
1032 $write =
array(
'searchindex' );
1033 $read =
array(
'page',
'revision',
'text',
'interwiki',
'l10n_cache',
'user' );
1034 $db->lockTables( $read, $write, __CLASS__ .
'::' . __METHOD__ );
1042 $db->unlockTables( __CLASS__ .
'::' . __METHOD__ );
1066 if ( $maxLockTime ) {
1067 $this->
output(
" --- Waiting for lock ---" );
1073 # Loop through the results and do a search update
1074 foreach ( $results
as $row ) {
1075 # Allow reads to be processed
1076 if ( $maxLockTime && time() > $lockTime + $maxLockTime ) {
1077 $this->
output(
" --- Relocking ---" );
1082 call_user_func( $callback, $dbw, $row );
1085 # Unlock searchindex
1086 if ( $maxLockTime ) {
1087 $this->
output(
" --- Unlocking --" );
1105 $titleObj =
$rev->getTitle();
1106 $title = $titleObj->getPrefixedDBkey();
1107 $this->
output(
"$title..." );
1108 # Update searchindex
1109 $u =
new SearchUpdate( $pageId, $titleObj->getText(),
$rev->getContent() );
1125 if ( !function_exists(
'posix_isatty' ) ) {
1137 public static function readconsole( $prompt =
'> ' ) {
1138 static $isatty =
null;
1139 if ( is_null( $isatty ) ) {
1143 if ( $isatty && function_exists(
'readline' ) ) {
1144 return readline( $prompt );
1149 if ( feof( STDIN ) ) {
1152 $st = fgets( STDIN, 1024 );
1155 if ( $st ===
false ) {
1158 $resp = trim( $st );
1173 $command =
"read -er -p $encPrompt && echo \"\$REPLY\"";
1190 if ( feof( STDIN ) ) {
1194 return fgets( STDIN, 1024 );
1202 protected $mSelf =
"FakeMaintenanceScript";
1214 parent::__construct();
1215 $this->
addOption(
'force',
'Run the update even if it was completed already' );
1224 && $db->selectRow(
'updatelog',
'1',
array(
'ul_key' => $key ), __METHOD__ )
1234 if ( $db->insert(
'updatelog',
array(
'ul_key' => $key ), __METHOD__,
'IGNORE' ) ) {
1248 return "Update '{$key}' already logged as completed.";
1257 return "Unable to log update '{$key}' as completed.";
const RUN_MAINTENANCE_IF_MAIN
int $mBatchSize
Batch size.
__construct()
Default constructor.
wfShellExec( $cmd, &$retval=null, $environ=array(), $limits=array(), $options=array())
Execute a shell command, with time and memory limits mirrored from the PHP configuration if supported...
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getStdin( $len=null)
Return input from stdin.
static instance()
Singleton.
getDbType()
Does the script need different DB access? By default, we give Maintenance scripts normal rights to th...
maybeHelp( $force=false)
Maybe show the help.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
addDescription( $text)
Set the description text.
setup()
Do some sanity checking and basic setup.
runChild( $maintClass, $classFile=null)
Run a child maintenance script.
static readconsole( $prompt='> ')
Prompt the console for input.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false)
Add a parameter to the script.
loadParamsAndArgs( $self=null, $opts=null, $args=null)
Process command line arguments $mOptions becomes an array with keys set to the option names $mArgs be...
wfPHPVersionError( $type)
Display something vaguely comprehensible in the event of a totally unrecoverable error.
unlockSearchindex(&$db)
Unlock the tables.
getName()
Get the script's name.
hasArg( $argId=0)
Does a given argument exist?
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
The least sophisticated profiler output class possible, view your source! :)
static locateExecutableInDefaultPaths( $names, $versionInfo=false)
Same as locateExecutable(), but checks in getPossibleBinPaths() by default.
finalSetup()
Handle some last-minute setup here.
relockSearchindex(&$db)
Unlock and lock again Since the lock is low-priority, queued reads will be able to complete.
setDB(&$db)
Sets database object to be returned by getDB().
afterFinalSetup()
Execute a callback function at the end of initialisation.
clearParamsAndArgs()
Clear all params and arguments.
& getDB( $db, $groups=array(), $wiki=false)
Returns a database to be used by current maintenance script.
updateSearchIndex( $maxLockTime, $callback, $dbw, $results)
Perform a search index update with locking.
lockSearchindex(&$db)
Lock the search index.
public function __construct()
loadSpecialVars()
Handle the special variables that are global to all scripts.
Class for scripts that perform database maintenance and want to log the update in updatelog so we can...
global $wgCommandLineMode
static loadFromPageId( $db, $pageid, $id=0)
Load either the current, or a specified, revision that's attached to a given page.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
globals()
Potentially debug globals.
updatelogFailedMessage()
Message to show the the update log was unable to log the completion of this update.
when a variable name is used in a it is silently declared as a new masking the global
Fake maintenance wrapper, mostly used for the web installer/updater.
addDefaultParams()
Add the default parameters to the scripts.
static readlineEmulation( $prompt)
Emulate readline()
deleteOption( $name)
Remove an option.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
static shouldExecute()
Should we execute the maintenance script, or just allow it to be included as a standalone class?...
execute()
Do the actual work.
presenting them properly to the user as errors is done by the caller $title
Allows to change the fields on the form that will be generated $name
updateSearchIndexForPage( $dbw, $pageId)
Update the searchindex table for a given pageid.
static setInstance(Profiler $p)
Set the profiler to a specific profiler instance.
Database abstraction object.
wfIsWindows()
Check if the operating system is Windows.
wfEscapeShellArg()
Windows-compatible version of escapeshellarg() Windows doesn't recognise single-quotes in the shell,...
static posix_isatty( $fd)
Wrapper for posix_isatty() We default as considering stdin a tty (for nice readline methods) but trea...
updateSkippedMessage()
Message to show that the update was done already and was just skipped.
validateParamsAndArgs()
Run some validation checks on the params, etc.
cleanupChanneled()
Clean up channeled output.
const DB_NONE
Constants for DB access type.
loadSettings()
Generic setup for most installs.
doDBUpdates()
Do the actual work.
adjustMemoryLimit()
Adjusts PHP's memory limit to better suit our needs, if needed.
getUpdateKey()
Get the update key name to go in the update log table.
purgeRedundantText( $delete=true)
Support function for cleaning up redundant text records.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
resource $fileHandle
Used when creating separate schema files.
DatabaseBase $mDb
Used by getDD() / setDB()
getOption( $name, $default=null)
Get an option, or return the default.
addArg( $arg, $description, $required=true)
Add some args that are needed.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
error( $err, $die=0)
Throw an error to the user.
output( $out, $channel=null)
Throw some output to the user.
getDir()
Get the maintenance directory.
hasOption( $name)
Checks to see if a particular param exists.
getArg( $argId=0, $default=null)
Get an argument.
public function execute()
outputChanneled( $msg, $channel=null)
Message outputter with channeled message support.
__construct()
Default constructor.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account incomplete not yet checked for validity & $retval
execute()
Do the actual work.
setBatchSize( $s=0)
Set the batch size.
static destroyInstance()
Shut down, close connections and destroy the cached instance.
memoryLimit()
Normally we disable the memory_limit when running admin scripts.