X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FimportSites.php;h=572234422f8aa863be799d1ccc2e928fd78e9344;hb=6a4c5f37dce1c30c7c2964a09a18abe90866d34f;hp=c5c00aa24d64be2967d4b8cf8eafe795098c5cba;hpb=072e84d2480446f3b76c6cffe9cd414de5b0860c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/importSites.php b/maintenance/importSites.php index c5c00aa24d..572234422f 100644 --- a/maintenance/importSites.php +++ b/maintenance/importSites.php @@ -15,7 +15,7 @@ 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 @@ -30,8 +30,9 @@ class ImportSites extends Maintenance { 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 );