X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FexportSites.php;h=542bddac79bd45403fad23762b84e521f309e2b2;hb=918fee715de966760522725b28ab1c757b6cee46;hp=145c9249236952f7e6c80515414c415aa80838f5;hpb=4618f70793d1178ca4c646ef397cf17b1cc70b44;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/exportSites.php b/maintenance/exportSites.php index 145c924923..542bddac79 100644 --- a/maintenance/exportSites.php +++ b/maintenance/exportSites.php @@ -15,7 +15,7 @@ require_once $basePath . '/maintenance/Maintenance.php'; class ExportSites extends Maintenance { public function __construct() { - $this->mDescription = 'Exports site definitions the sites table to XML file'; + $this->addDescription( 'Exports site definitions the sites table to XML file' ); $this->addArg( 'file', 'A file to write the XML to (see docs/sitelist.txt). ' . 'Use "php://stdout" to write to stdout.', true @@ -37,13 +37,13 @@ class ExportSites extends Maintenance { $handle = fopen( $file, 'w' ); if ( !$handle ) { - $this->error( "Failed to open $file for writing.\n", 1 ); + $this->fatalError( "Failed to open $file for writing.\n" ); } $exporter = new SiteExporter( $handle ); - $sites = SiteSQLStore::newInstance()->getSites( 'recache' ); - $exporter->exportSites( $sites ); + $siteLookup = \MediaWiki\MediaWikiServices::getInstance()->getSiteLookup(); + $exporter->exportSites( $siteLookup->getSites() ); fclose( $handle );