X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportSites.php;h=572234422f8aa863be799d1ccc2e928fd78e9344;hb=53ecf20db8bfc2109553e80bf932dac7321d63ec;hp=7abb8d72b864a5bcd25656e225449844438cfc18;hpb=8e30e6663afe287e3a1380b3f2dc4df72fbf5d5f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importSites.php b/maintenance/importSites.php index 7abb8d72b8..572234422f 100644 --- a/maintenance/importSites.php +++ b/maintenance/importSites.php @@ -15,22 +15,24 @@ require_once $basePath . '/maintenance/Maintenance.php'; class ImportSites extends Maintenance { public function __construct() { - $this->mDescription = 'Imports site definitions from XML into the sites table.'; + $this->addDescription( 'Imports site definitions from XML into the sites table.' ); - $this->addArg( 'file', 'An XML file containing site definitions (see docs/sitelist.txt). Use "php://stdin" to read from stdin.', true ); + $this->addArg( 'file', 'An XML file containing site definitions (see docs/sitelist.txt). ' . + 'Use "php://stdin" to read from stdin.', true + ); parent::__construct(); } - /** * Do the import. */ public function execute() { $file = $this->getArg( 0 ); - $importer = new SiteImporter( SiteSQLStore::newInstance() ); - $importer->setExceptionCallback( array( $this, 'reportException' ) ); + $siteStore = \MediaWiki\MediaWikiServices::getInstance()->getSiteStore(); + $importer = new SiteImporter( $siteStore ); + $importer->setExceptionCallback( [ $this, 'reportException' ] ); $importer->importFromFile( $file ); @@ -49,4 +51,4 @@ class ImportSites extends Maintenance { } $maintClass = 'ImportSites'; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;