*/
private $source;
- /**
- * @var BagOStuff
- */
- private $cache;
-
public function __construct() {
parent::__construct();
}
public function execute() {
- $force = $this->getOption( 'force', false );
+ $force = $this->hasOption( 'force' );
$this->source = $this->getOption( 'source', 'https://en.wikipedia.org/w/api.php' );
- $this->cache = wfGetMainCache();
-
$data = $this->fetchLinks();
if ( $data === false ) {
__METHOD__
);
- if ( ! $row ) {
+ if ( !$row ) {
$dbw->insert(
'interwiki',
[
);
}
- $this->clearCacheEntry( $prefix );
+ Interwiki::invalidateCache( $prefix );
}
$this->output( "Interwiki links are populated.\n" );
return true;
}
- /**
- * @param string $prefix
- */
- private function clearCacheEntry( $prefix ) {
- $key = wfMemcKey( 'interwiki', $prefix );
- $this->cache->delete( $key );
- }
-
}
$maintClass = PopulateInterwiki::class;