* Update the version every time you make breaking or significant changes. */
const VERSION = "2.1";
+ /**
+ * List of iiprop values for the thumbnail fetch queries.
+ * @since 1.23
+ */
+ protected static $imageInfoProps = array(
+ 'url',
+ 'thumbnail',
+ 'timestamp',
+ );
+
var $fileFactory = array( 'ForeignAPIFile', 'newFromTitle' );
/* Check back with Commons after a day */
var $apiThumbCacheExpiry = 86400; /* 24*60*60 */
function getThumbUrl( $name, $width = -1, $height = -1, &$result = null, $otherParams = '' ) {
$data = $this->fetchImageQuery( array(
'titles' => 'File:' . $name,
- 'iiprop' => 'url|timestamp',
+ 'iiprop' => self::getIIProps(),
'iiurlwidth' => $width,
'iiurlheight' => $height,
'iiurlparam' => $otherParams,
function getThumbError( $name, $width = -1, $height = -1, $otherParams = '', $lang = null ) {
$data = $this->fetchImageQuery( array(
'titles' => 'File:' . $name,
- 'iiprop' => 'url|timestamp',
+ 'iiprop' => self::getIIProps(),
'iiurlwidth' => $width,
'iiurlheight' => $height,
'iiurlparam' => $otherParams,
}
}
+ /**
+ * @return string
+ * @since 1.23
+ */
+ protected static function getIIProps() {
+ return join( '|', self::$imageInfoProps );
+ }
+
/**
* HTTP GET request to a mediawiki API (with caching)
* @param $target string Used in cache key creation, mostly