mDescription = "Dumps site store as json"; $this->addOption( 'file', 'File to output the json to', false, true ); } public function execute() { $siteListFileCacheBuilder = new SiteListFileCacheBuilder( SiteSQLStore::newInstance(), $this->getCacheFile() ); $siteListFileCacheBuilder->build(); } /** * @return string */ private function getCacheFile() { if ( $this->hasOption( 'file' ) ) { $jsonFile = $this->getOption( 'file' ); } else { $jsonFile = $this->getConfig()->get( 'SitesCacheFile' ); if ( $jsonFile === false ) { $this->error( 'Error: No sites cache file is set in configuration.', 1 ); } } return $jsonFile; } } $maintClass = "RebuildSitesCache"; require_once RUN_MAINTENANCE_IF_MAIN;