X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FexportSites.php;h=736b12b3047cf1b00ee504f6656b0f42ef6a20c3;hb=f2b621be73632b17d7e647b10959a0ed7dae9284;hp=1c71dc0ed070d748a2083cc7dd2cf8d1f0f4040e;hpb=61b2f07f6b4eb3ff676130126b40f519e125690c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/exportSites.php b/maintenance/exportSites.php index 1c71dc0ed0..736b12b304 100644 --- a/maintenance/exportSites.php +++ b/maintenance/exportSites.php @@ -9,15 +9,17 @@ require_once $basePath . '/maintenance/Maintenance.php'; * * @since 1.25 * - * @licence GNU GPL v2+ + * @license GNU GPL v2+ * @author Daniel Kinzler */ 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 ) { - $this->error( "Failed to open $file for writing.\n", 1 ); + if ( !$handle ) { + $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 ); @@ -50,5 +52,5 @@ class ExportSites extends Maintenance { } -$maintClass = 'ExportSites'; -require_once( RUN_MAINTENANCE_IF_MAIN ); +$maintClass = ExportSites::class; +require_once RUN_MAINTENANCE_IF_MAIN;