}
function transform( $params, $flags = 0 ) {
- if ( $this->repo->canCacheThumbs() ) {
- $thumbUrl = $this->repo->getThumbUrlFromCache(
- $this->getName(),
- isset( $params['width'] ) ? $params['width'] : -1,
- isset( $params['height'] ) ? $params['height'] : -1 );
- } else {
- $thumbUrl = $this->repo->getThumbUrl(
+ $thumbUrl = $this->repo->getThumbUrlFromCache(
$this->getName(),
isset( $params['width'] ) ? $params['width'] : -1,
isset( $params['height'] ) ? $params['height'] : -1 );
- }
if( $thumbUrl ) {
return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );;
}
function getThumbUrlFromCache( $name, $width, $height ) {
global $wgMemc, $wgUploadPath, $wgServer, $wgUploadDirectory;
+ if ( !$this->canCacheThumbs() ) {
+ return $this->getThumbUrl();
+ }
+
$key = wfMemcKey( 'ForeignAPIRepo', 'ThumbUrl', $name );
if ( $thumbUrl = $wgMemc->get($key) ) {
wfDebug("Got thumb from local cache. $thumbUrl \n");