Revert r40385. Half-assed attempt at making something configurable that doesn't need...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 5 Sep 2008 18:29:42 +0000 (18:29 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 5 Sep 2008 18:29:42 +0000 (18:29 +0000)
includes/DefaultSettings.php
includes/filerepo/File.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIFile.php
includes/filerepo/ForeignAPIRepo.php

index fa6ea93..eb39029 100644 (file)
@@ -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:
index c22d00d..0bdede5 100644 (file)
@@ -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 );
                }
index 88504ae..23a132e 100644 (file)
@@ -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];
index c97d225..42bd7e1 100644 (file)
@@ -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 . '/';
                        }
index 3334e9a..bd53686 100644 (file)
@@ -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);