X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FForeignAPIFile.php;h=1002b82c52b2a579d20a3eb54e8a781506c7cef5;hp=be88b49a608c21cbec7302bf26a21303a3a23b06;hb=478a58f63101f2b47d18a618296b5e7970fa3f24;hpb=c2f9376c19335219d403e602496fa44f4a3e7b55 diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php index be88b49a60..1002b82c52 100644 --- a/includes/filerepo/file/ForeignAPIFile.php +++ b/includes/filerepo/file/ForeignAPIFile.php @@ -21,6 +21,8 @@ * @ingroup FileAbstraction */ +use MediaWiki\MediaWikiServices; + /** * Foreign file accessible through api.php requests. * Very hacky and inefficient, do not use :D @@ -33,7 +35,7 @@ class ForeignAPIFile extends File { /** @var array */ private $mInfo = []; - protected $repoClass = ForeignApiRepo::class; + protected $repoClass = ForeignAPIRepo::class; /** * @param Title|string|bool $title @@ -360,7 +362,7 @@ class ForeignAPIFile extends File { $url = $this->repo->getDescriptionRenderUrl( $this->getName(), $wgContLang->getCode() ); $key = $this->repo->getLocalCacheKey( 'RemoteFileDescription', 'url', md5( $url ) ); - ObjectCache::getMainWANInstance()->delete( $key ); + MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key ); } /** @@ -368,7 +370,7 @@ class ForeignAPIFile extends File { */ function purgeThumbnails( $options = [] ) { $key = $this->repo->getLocalCacheKey( 'ForeignAPIRepo', 'ThumbUrl', $this->getName() ); - ObjectCache::getMainWANInstance()->delete( $key ); + MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key ); $files = $this->getThumbnails(); // Give media handler a chance to filter the purge list