MediaWiki REL1_40
|
A runner for maintenance scripts. More...
Public Member Functions | |
__construct () | |
Default constructor. | |
cleanup () | |
Handler for register_shutdown_function. | |
defineSettings () | |
Define how settings are loaded (e.g. | |
getName () | |
Returns the maintenance script name to show in the help message. | |
initForClass (string $scriptClass, $argv) | |
Initialize the runner for the given class. | |
initFromWrapper (array $argv) | |
Initialize the runner from the given command line arguments as passed to a wrapper script. | |
run () | |
Run the maintenance script. | |
setup (SettingsBuilder $settings) | |
MW_FINAL_SETUP_CALLBACK handler, for setting up the Maintenance object. | |
Static Public Member Functions | |
static | emulateConfig (SettingsBuilder $settings) |
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) | |
Protected Member Functions | |
addDefaultParams () | |
Add the default parameters to the scripts. | |
error (string $msg) | |
fatalError ( $msg, $exitCode=1) | |
Output a message and terminate the current script. | |
findScriptClass (string $script) | |
getExtensionInfo (string $extName) | |
getScriptClass () | |
preloadScriptFile (string $script) | |
Preload the script file, so any defines in file level code are executed. | |
A runner for maintenance scripts.
Definition at line 23 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::__construct | ( | ) |
Default constructor.
Children should call this first if implementing their own constructors
Definition at line 61 of file MaintenanceRunner.php.
References MediaWiki\Maintenance\MaintenanceRunner\addDefaultParams().
|
protected |
Add the default parameters to the scripts.
Definition at line 69 of file MaintenanceRunner.php.
References Maintenance\GENERIC_MAINTENANCE_PARAMETERS.
Referenced by MediaWiki\Maintenance\MaintenanceRunner\__construct().
MediaWiki\Maintenance\MaintenanceRunner::cleanup | ( | ) |
Handler for register_shutdown_function.
Definition at line 767 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::defineSettings | ( | ) |
Define how settings are loaded (e.g.
LocalSettings.php)
Definition at line 526 of file MaintenanceRunner.php.
References $IP, $wgCommandLineMode, and wfDetectLocalSettingsFile().
|
static |
SettingsBuilder | $settings |
Definition at line 580 of file MaintenanceRunner.php.
References MediaWiki\Settings\SettingsBuilder\overrideConfigValue().
|
protected |
string | $msg |
Definition at line 723 of file MaintenanceRunner.php.
|
protected |
Output a message and terminate the current script.
string | $msg | Error message |
int | $exitCode | PHP exit status. Should be in range 1-254. |
Definition at line 715 of file MaintenanceRunner.php.
|
protected |
string | $script |
Definition at line 391 of file MaintenanceRunner.php.
|
protected |
Definition at line 237 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::getName | ( | ) |
Returns the maintenance script name to show in the help message.
Definition at line 482 of file MaintenanceRunner.php.
|
protected |
Definition at line 369 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::initForClass | ( | string | $scriptClass, |
$argv ) |
Initialize the runner for the given class.
This is used when running scripts directly, without a wrapper.
string | $scriptClass | The script class to run |
string[] | $argv | The arguments to passed to the script, including the script itself at index 0. |
Definition at line 178 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::initFromWrapper | ( | array | $argv | ) |
Initialize the runner from the given command line arguments as passed to a wrapper script.
string[] | $argv | The arguments passed from the command line, including the wrapper script at index 0, and usually the script to run at index 1. |
Definition at line 120 of file MaintenanceRunner.php.
|
protected |
Preload the script file, so any defines in file level code are executed.
This way, scripts can control what Setup.php does.
string | $script |
Definition at line 336 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::run | ( | ) |
Run the maintenance script.
Definition at line 643 of file MaintenanceRunner.php.
MediaWiki\Maintenance\MaintenanceRunner::setup | ( | SettingsBuilder | $settings | ) |
MW_FINAL_SETUP_CALLBACK handler, for setting up the Maintenance object.
SettingsBuilder | $settings |
Definition at line 427 of file MaintenanceRunner.php.
|
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)
Definition at line 739 of file MaintenanceRunner.php.
References $wgCommandLineMode.