require_once __DIR__ . '/Maintenance.php';
/**
- * Maintenance script to dump the SiteStore as a static json file.
+ * Maintenance script to dump a SiteStore as a static json file.
*
* @ingroup Maintenance
*/
public function __construct() {
parent::__construct();
- $this->mDescription = "Dumps site store as json";
+ $this->addDescription( 'Cache sites as json for file-based lookup.' );
$this->addOption( 'file', 'File to output the json to', false, true );
}
public function execute() {
- $siteListFileCacheBuilder = new SiteListFileCacheBuilder(
- SiteSQLStore::newInstance(),
+ $sitesCacheFileBuilder = new SitesCacheFileBuilder(
+ \MediaWiki\MediaWikiServices::getInstance()->getSiteLookup(),
$this->getCacheFile()
);
- $siteListFileCacheBuilder->build();
+ $sitesCacheFileBuilder->build();
}
/**
$jsonFile = $this->getConfig()->get( 'SitesCacheFile' );
if ( $jsonFile === false ) {
- $this->error( 'Error: No sites cache file is set in configuration.', 1 );
+ $this->error( 'Error: No file set in configuration for SitesCacheFile.', 1 );
}
}