From: Chad Horohoe Date: Fri, 5 Sep 2008 18:29:42 +0000 (+0000) Subject: Revert r40385. Half-assed attempt at making something configurable that doesn't need... X-Git-Tag: 1.31.0-rc.0~45459 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=6eef7a366a0402fb1c635bfebdb580c231aa1cee;p=lhc%2Fweb%2Fwiklou.git Revert r40385. Half-assed attempt at making something configurable that doesn't need to be leads to borken code. /thumb/ is no longer configurable...just like it was before. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index fa6ea9361c..eb39029482 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -206,9 +206,6 @@ $wgFileStore['deleted']['hash'] = 3; ///< 3-level subdirectory split * 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: diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index c22d00d750..0bdede5420 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -747,7 +747,7 @@ abstract class File { /** 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; } @@ -777,7 +777,7 @@ abstract class File { /** 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 ); } @@ -797,7 +797,7 @@ abstract class File { /** 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 ); } diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 88504aef51..23a132eae5 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -15,7 +15,7 @@ abstract class FileRepo { 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 @@ -30,10 +30,9 @@ abstract class FileRepo { // 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]; diff --git a/includes/filerepo/ForeignAPIFile.php b/includes/filerepo/ForeignAPIFile.php index c97d225c8b..42bd7e10b8 100644 --- a/includes/filerepo/ForeignAPIFile.php +++ b/includes/filerepo/ForeignAPIFile.php @@ -31,7 +31,7 @@ class ForeignAPIFile extends File { } 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, @@ -110,9 +110,9 @@ class ForeignAPIFile extends File { */ 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 . '/'; } diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 3334e9ad21..bd53686d12 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -121,7 +121,7 @@ class ForeignAPIRepo extends FileRepo { } 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);