From 845490602fcb82422ffb54eafbc18ac5461812cb Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 3 Jan 2017 19:00:10 -0800 Subject: [PATCH] Avoid hardcoding cache and cache key in populateInterwiki.php Follows-up 0ac10f3790. Bug: T114577 Change-Id: I1f5fbc40adc66a673428e495be94fc8118d6e14f --- maintenance/populateInterwiki.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/maintenance/populateInterwiki.php b/maintenance/populateInterwiki.php index 5d32b998bd..6c812bf6ca 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(); @@ -64,8 +59,6 @@ TEXT $force = $this->getOption( 'force', false ); $this->source = $this->getOption( 'source', 'https://en.wikipedia.org/w/api.php' ); - $this->cache = wfGetMainCache(); - $data = $this->fetchLinks(); if ( $data === false ) { @@ -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; -- 2.20.1