4require_once __DIR__ .
'/Maintenance.php';
21 parent::__construct();
23 $this->
addDescription(
'Imports site definitions from XML into the sites table.' );
25 $this->
addArg(
'file',
'An XML file containing site definitions (see docs/sitelist.md). ' .
26 'Use "php://stdin" to read from stdin.',
true
34 $file = $this->
getArg( 0 );
38 $importer->setExceptionCallback( [ $this,
'reportException' ] );
40 $importer->importFromFile( $file );
42 $this->
output(
"Done.\n" );
49 $msg = $ex->getMessage();
56require_once RUN_MAINTENANCE_IF_MAIN;
Maintenance script for importing site definitions from XML into the sites table.
reportException(Exception $ex)
Outputs a message via the output() method.
__construct()
Default constructor.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addArg( $arg, $description, $required=true, $multi=false)
Add some args that are needed.
getArg( $argId=0, $default=null)
Get an argument.
output( $out, $channel=null)
Throw some output to the user.
getServiceContainer()
Returns the main service container.
addDescription( $text)
Set the description text.