X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FexportSites.php;h=b1e4fa943b96e33d8eaaf989f2dad353fbf19ae4;hb=5d945d8419027d709b8279d2fdf8cedbd9c85021;hp=1c71dc0ed070d748a2083cc7dd2cf8d1f0f4040e;hpb=a756c3b753e34a479da69a88a3176fd2d3e7cfa2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/exportSites.php b/maintenance/exportSites.php index 1c71dc0ed0..b1e4fa943b 100644 --- a/maintenance/exportSites.php +++ b/maintenance/exportSites.php @@ -15,9 +15,11 @@ 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 ); + $this->addArg( 'file', 'A file to write the XML to (see docs/sitelist.txt). ' . + 'Use "php://stdout" to write to stdout.', true + ); parent::__construct(); } @@ -34,14 +36,14 @@ class ExportSites extends Maintenance { $handle = fopen( $file, 'w' ); - if ( !$handle ) { + if ( !$handle ) { $this->error( "Failed to open $file for writing.\n", 1 ); } $exporter = new SiteExporter( $handle ); - $sites = SiteSQLStore::newInstance()->getSites( 'recache' ); - $exporter->exportSites( $sites ); + $siteLookup = \MediaWiki\MediaWikiServices::getInstance()->getSiteLookup(); + $exporter->exportSites( $siteLookup->getSites() ); fclose( $handle ); @@ -51,4 +53,4 @@ class ExportSites extends Maintenance { } $maintClass = 'ExportSites'; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;