X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateInterwiki.php;h=1b05e1ed03260507a3650bbc66b276e82aad60c2;hb=5e8e72f822b2223accdebecc017f7b6d5fe6b751;hp=5d32b998bd73e9af6b6d520fd282a59678aeb8d8;hpb=ff4181d4f09991fa507adae79f0b30f727cb17cf;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateInterwiki.php b/maintenance/populateInterwiki.php index 5d32b998bd..1b05e1ed03 100644 --- a/maintenance/populateInterwiki.php +++ b/maintenance/populateInterwiki.php @@ -33,11 +33,6 @@ class PopulateInterwiki extends Maintenance { */ private $source; - /** - * @var BagOStuff - */ - private $cache; - public function __construct() { parent::__construct(); @@ -61,11 +56,9 @@ TEXT } 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 ) { @@ -136,7 +129,7 @@ TEXT __METHOD__ ); - if ( ! $row ) { + if ( !$row ) { $dbw->insert( 'interwiki', [ @@ -149,7 +142,7 @@ TEXT ); } - $this->clearCacheEntry( $prefix ); + Interwiki::invalidateCache( $prefix ); } $this->output( "Interwiki links are populated.\n" ); @@ -157,14 +150,6 @@ TEXT return true; } - /** - * @param string $prefix - */ - private function clearCacheEntry( $prefix ) { - $key = wfMemcKey( 'interwiki', $prefix ); - $this->cache->delete( $key ); - } - } $maintClass = PopulateInterwiki::class;