*/
use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
/**
* A foreign repository with a remote MediaWiki with an API thingy
parent::__construct( $info );
// https://commons.wikimedia.org/w/api.php
- $this->mApiBase = isset( $info['apibase'] ) ? $info['apibase'] : null;
+ $this->mApiBase = $info['apibase'] ?? null;
if ( isset( $info['apiThumbCacheExpiry'] ) ) {
$this->apiThumbCacheExpiry = $info['apiThumbCacheExpiry'];
* @return bool|string
*/
function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
// We can't check the local cache using FileRepo functions because
// we override fileExistsBatch(). We have to use the FileBackend directly.
$backend = $this->getBackend(); // convenience
$url = $this->makeUrl( $query, 'api' );
}
- $cache = ObjectCache::getMainWANInstance();
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
return $cache->getWithSetCallback(
$this->getLocalCacheKey( static::class, $target, md5( $url ) ),
$cacheTTL,