+
+ /**
+ * @return string
+ * @since 1.23
+ */
+ protected static function getIIProps() {
+ return implode( '|', self::$imageInfoProps );
+ }
+
+ /**
+ * HTTP GET request to a mediawiki API (with caching)
+ * @param string $target Used in cache key creation, mostly
+ * @param array $query The query parameters for the API request
+ * @param int $cacheTTL Time to live for the memcached caching
+ * @return string|null
+ */
+ public function httpGetCached( $target, $query, $cacheTTL = 3600 ) {
+ if ( $this->mApiBase ) {
+ $url = wfAppendQuery( $this->mApiBase, $query );
+ } else {
+ $url = $this->makeUrl( $query, 'api' );
+ }
+
+ $cache = ObjectCache::getMainWANInstance();
+ return $cache->getWithSetCallback(
+ $this->getLocalCacheKey( static::class, $target, md5( $url ) ),
+ $cacheTTL,
+ function ( $curValue, &$ttl ) use ( $url, $cache ) {
+ $html = self::httpGet( $url, 'default', [], $mtime );
+ if ( $html !== false ) {
+ $ttl = $mtime ? $cache->adaptiveTTL( $mtime, $ttl ) : $ttl;
+ } else {
+ $ttl = $cache->adaptiveTTL( $mtime, $ttl );
+ $html = null; // caches negatives
+ }
+
+ return $html;
+ },
+ [ 'pcTTL' => $cache::TTL_PROC_LONG ]
+ );
+ }
+
+ /**
+ * @param callable $callback
+ * @throws MWException
+ */
+ function enumFiles( $callback ) {
+ throw new MWException( 'enumFiles is not supported by ' . static::class );
+ }
+
+ /**
+ * @throws MWException
+ */
+ protected function assertWritableRepo() {
+ throw new MWException( static::class . ': write operations are not supported.' );
+ }