Linker: Don't use Title::setFragment()
[lhc/web/wiklou.git] / maintenance / importSites.php
index c5c00aa..5722344 100644 (file)
@@ -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 );