addDescription( 'Clear all interwiki links for all languages from the cache' ); } public function execute() { $lookup = $this->getServiceContainer()->getInterwikiLookup(); $dbr = $this->getReplicaDB(); $prefixes = $dbr->newSelectQueryBuilder() ->select( 'iw_prefix' ) ->from( 'interwiki' ) ->caller( __METHOD__ ) ->fetchFieldValues(); foreach ( $prefixes as $prefix ) { $this->output( "...$prefix\n" ); $lookup->invalidateCache( $prefix ); } $this->output( "done\n" ); } } // @codeCoverageIgnoreStart $maintClass = ClearInterwikiCache::class; require_once RUN_MAINTENANCE_IF_MAIN; // @codeCoverageIgnoreEnd