Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | var $thumbScriptUrl, $transformVia404; |
17 | 17 | var $descBaseUrl, $scriptDirUrl, $articleUrl, $fetchDescription, $initialCapital; |
18 | 18 | var $pathDisclosureProtection = 'paranoid'; |
19 | | - var $descriptionCacheExpiry, $apiThumbCacheExpiry, $thumbDir; |
| 19 | + var $descriptionCacheExpiry, $apiThumbCacheExpiry, $apiThumbCacheDir; |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Factory functions for creating new files |
— | — | @@ -30,10 +30,9 @@ |
31 | 31 | |
32 | 32 | // Optional settings |
33 | 33 | $this->initialCapital = true; // by default |
34 | | - $this->thumbDir = 'thumb/'; // sane default |
35 | 34 | foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription', |
36 | 35 | 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', |
37 | | - 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'thumbDir') as $var ) |
| 36 | + 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'apiThumbCacheDir' ) as $var ) |
38 | 37 | { |
39 | 38 | if ( isset( $info[$var] ) ) { |
40 | 39 | $this->$var = $info[$var]; |
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | } |
123 | 123 | else { |
124 | 124 | $foreignUrl = $this->getThumbUrl( $name, $width, $height ); |
125 | | - $path = $this->thumbDir . '/' . $this->name . '/' . |
| 125 | + $path = $this->apiThumbCacheDir . '/' . $this->name . '/' . |
126 | 126 | $name . '/'; |
127 | 127 | if ( !is_dir($wgUploadDirectory . '/' . $path) ) { |
128 | 128 | wfMkdirParents($wgUploadDirectory . '/' . $path); |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -747,7 +747,7 @@ |
748 | 748 | |
749 | 749 | /** Get relative path for a thumbnail file */ |
750 | 750 | function getThumbRel( $suffix = false ) { |
751 | | - $path = $this->repo->thumbDir . $this->getRel(); |
| 751 | + $path = 'thumb/' . $this->getRel(); |
752 | 752 | if ( $suffix !== false ) { |
753 | 753 | $path .= '/' . $suffix; |
754 | 754 | } |
— | — | @@ -777,7 +777,7 @@ |
778 | 778 | |
779 | 779 | /** Get the URL of the thumbnail directory, or a particular file if $suffix is specified */ |
780 | 780 | function getThumbUrl( $suffix = false ) { |
781 | | - $path = $this->repo->getZoneUrl('public') . '/'. $this->repo->thumbDir . $this->getUrlRel(); |
| 781 | + $path = $this->repo->getZoneUrl('public') . '/thumb/' . $this->getUrlRel(); |
782 | 782 | if ( $suffix !== false ) { |
783 | 783 | $path .= '/' . rawurlencode( $suffix ); |
784 | 784 | } |
— | — | @@ -797,7 +797,7 @@ |
798 | 798 | |
799 | 799 | /** Get the virtual URL for a thumbnail file or directory */ |
800 | 800 | function getThumbVirtualUrl( $suffix = false ) { |
801 | | - $path = $this->repo->getVirtualUrl() . '/public/' . $this->repo->thumbDir . $this->getUrlRel(); |
| 801 | + $path = $this->repo->getVirtualUrl() . '/public/thumb/' . $this->getUrlRel(); |
802 | 802 | if ( $suffix !== false ) { |
803 | 803 | $path .= '/' . rawurlencode( $suffix ); |
804 | 804 | } |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | } |
33 | 33 | |
34 | 34 | function transform( $params, $flags = 0 ) { |
35 | | - if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) { |
| 35 | + if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->apiThumbCacheDir ) { |
36 | 36 | $thumbUrl = $this->repo->getThumbUrlFromCache( |
37 | 37 | $this->getName(), |
38 | 38 | isset( $params['width'] ) ? $params['width'] : -1, |
— | — | @@ -110,9 +110,9 @@ |
111 | 111 | */ |
112 | 112 | function getThumbPath( $suffix = '' ) { |
113 | 113 | $ret = null; |
114 | | - if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->thumbDir ) { |
| 114 | + if ( $this->repo->apiThumbCacheExpiry > 0 && $this->repo->apiThumbCacheDir ) { |
115 | 115 | global $wgUploadDirectory; |
116 | | - $path = $wgUploadDirectory . '/' . $this->repo->thumbDir . '/' . $this->repo->name . '/'; |
| 116 | + $path = $wgUploadDirectory . '/' . $this->repo->apiThumbCacheDir . '/' . $this->repo->name . '/'; |
117 | 117 | if ( $suffix ) { |
118 | 118 | $path = $path . $suffix . '/'; |
119 | 119 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -206,9 +206,6 @@ |
207 | 207 | * May be 'paranoid' to remove all parameters from error messages, 'none' to |
208 | 208 | * leave the paths in unchanged, or 'simple' to replace paths with |
209 | 209 | * placeholders. Default for LocalRepo is 'simple'. |
210 | | - * thumbDir |
211 | | - * Sub-directory of $wgUploadPath in which to place thumbnails. Defaults to |
212 | | - * 'thumb/'. |
213 | 210 | * |
214 | 211 | * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored |
215 | 212 | * for local repositories: |