* May be 'paranoid' to remove all parameters from error messages, 'none' to
* leave the paths in unchanged, or 'simple' to replace paths with
* placeholders. Default for LocalRepo is 'simple'.
- * thumbDir
- * Sub-directory of $wgUploadPath in which to place thumbnails. Defaults to
- * 'thumb/'.
*
* These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
* for local repositories:
/** Get relative path for a thumbnail file */
function getThumbRel( $suffix = false ) {
- $path = $this->repo->thumbDir . $this->getRel();
+ $path = 'thumb/' . $this->getRel();
if ( $suffix !== false ) {
$path .= '/' . $suffix;
}
/** Get the URL of the thumbnail directory, or a particular file if $suffix is specified */
function getThumbUrl( $suffix = false ) {
- $path = $this->repo->getZoneUrl('public') . '/'. $this->repo->thumbDir . $this->getUrlRel();
+ $path = $this->repo->getZoneUrl('public') . '/thumb/' . $this->getUrlRel();
if ( $suffix !== false ) {
$path .= '/' . rawurlencode( $suffix );
}
/** Get the virtual URL for a thumbnail file or directory */
function getThumbVirtualUrl( $suffix = false ) {
- $path = $this->repo->getVirtualUrl() . '/public/' . $this->repo->thumbDir . $this->getUrlRel();
+ $path = $this->repo->getVirtualUrl() . '/public/thumb/' . $this->getUrlRel();
if ( $suffix !== false ) {
$path .= '/' . rawurlencode( $suffix );
}
var $thumbScriptUrl, $transformVia404;
var $descBaseUrl, $scriptDirUrl, $articleUrl, $fetchDescription, $initialCapital;
var $pathDisclosureProtection = 'paranoid';
- var $descriptionCacheExpiry, $apiThumbCacheExpiry, $thumbDir;
+ var $descriptionCacheExpiry, $apiThumbCacheExpiry, $apiThumbCacheDir;
/**
* Factory functions for creating new files
// Optional settings
$this->initialCapital = true; // by default
- $this->thumbDir = 'thumb/'; // sane default
foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection',
- 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'thumbDir') as $var )
+ 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'apiThumbCacheDir' ) as $var )
{
if ( isset( $info[$var] ) ) {
$this->$var = $info[$var];
}
function transform( $params, $flags = 0 ) {
- if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) {
+ if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->apiThumbCacheDir ) {
$thumbUrl = $this->repo->getThumbUrlFromCache(
$this->getName(),
isset( $params['width'] ) ? $params['width'] : -1,
*/
function getThumbPath( $suffix = '' ) {
$ret = null;
- if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) {
+ if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->apiThumbCacheDir ) {
global $wgUploadDirectory;
- $path = $wgUploadDirectory . '/' . $this->repo->thumbDir . '/' . $this->repo->name . '/';
+ $path = $wgUploadDirectory . '/' . $this->repo->apiThumbCacheDir . '/' . $this->repo->name . '/';
if ( $suffix ) {
$path = $path . $suffix . '/';
}
}
else {
$foreignUrl = $this->getThumbUrl( $name, $width, $height );
- $path = $this->thumbDir . '/' . $this->name . '/' .
+ $path = $this->apiThumbCacheDir . '/' . $this->name . '/' .
$name . '/';
if ( !is_dir($wgUploadDirectory . '/' . $path) ) {
wfMkdirParents($wgUploadDirectory . '/' . $path);