Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -24,6 +24,16 @@ |
25 | 25 | $info['deletedHashLevels'] : $this->hashLevels; |
26 | 26 | $this->deletedDir = isset( $info['deletedDir'] ) ? $info['deletedDir'] : false; |
27 | 27 | $this->fileMode = isset( $info['fileMode'] ) ? $info['fileMode'] : 0644; |
| 28 | + if ( isset( $info['thumbDir'] ) ) { |
| 29 | + $this->thumbDir = $info['thumbDir']; |
| 30 | + } else { |
| 31 | + $this->thumbDir = "{$this->directory}/thumb"; |
| 32 | + } |
| 33 | + if ( isset( $info['thumbUrl'] ) ) { |
| 34 | + $this->thumbUrl = $info['thumbUrl']; |
| 35 | + } else { |
| 36 | + $this->thumbUrl = "{$this->url}/thumb"; |
| 37 | + } |
28 | 38 | } |
29 | 39 | |
30 | 40 | /** |
— | — | @@ -58,6 +68,8 @@ |
59 | 69 | return "{$this->directory}/temp"; |
60 | 70 | case 'deleted': |
61 | 71 | return $this->deletedDir; |
| 72 | + case 'thumb': |
| 73 | + return $this->thumbDir; |
62 | 74 | default: |
63 | 75 | return false; |
64 | 76 | } |
— | — | @@ -74,6 +86,8 @@ |
75 | 87 | return "{$this->url}/temp"; |
76 | 88 | case 'deleted': |
77 | 89 | return false; // no public URL |
| 90 | + case 'thumb': |
| 91 | + return $this->thumbUrl; |
78 | 92 | default: |
79 | 93 | return false; |
80 | 94 | } |
Index: trunk/phase3/includes/filerepo/File.php |
— | — | @@ -746,15 +746,6 @@ |
747 | 747 | return $path; |
748 | 748 | } |
749 | 749 | |
750 | | - /** Get relative path for a thumbnail file */ |
751 | | - function getThumbRel( $suffix = false ) { |
752 | | - $path = 'thumb/' . $this->getRel(); |
753 | | - if ( $suffix !== false ) { |
754 | | - $path .= '/' . $suffix; |
755 | | - } |
756 | | - return $path; |
757 | | - } |
758 | | - |
759 | 750 | /** Get the path of the archive directory, or a particular file if $suffix is specified */ |
760 | 751 | function getArchivePath( $suffix = false ) { |
761 | 752 | return $this->repo->getZonePath('public') . '/' . $this->getArchiveRel( $suffix ); |
— | — | @@ -762,7 +753,11 @@ |
763 | 754 | |
764 | 755 | /** Get the path of the thumbnail directory, or a particular file if $suffix is specified */ |
765 | 756 | function getThumbPath( $suffix = false ) { |
766 | | - return $this->repo->getZonePath('public') . '/' . $this->getThumbRel( $suffix ); |
| 757 | + $path = $this->repo->getZonePath('thumb') . '/' . $this->getRel(); |
| 758 | + if ( $suffix !== false ) { |
| 759 | + $path .= '/' . $suffix; |
| 760 | + } |
| 761 | + return $path; |
767 | 762 | } |
768 | 763 | |
769 | 764 | /** Get the URL of the archive directory, or a particular file if $suffix is specified */ |
— | — | @@ -778,7 +773,7 @@ |
779 | 774 | |
780 | 775 | /** Get the URL of the thumbnail directory, or a particular file if $suffix is specified */ |
781 | 776 | function getThumbUrl( $suffix = false ) { |
782 | | - $path = $this->repo->getZoneUrl('public') . '/thumb/' . $this->getUrlRel(); |
| 777 | + $path = $this->repo->getZoneUrl('thumb') . '/' . $this->getUrlRel(); |
783 | 778 | if ( $suffix !== false ) { |
784 | 779 | $path .= '/' . rawurlencode( $suffix ); |
785 | 780 | } |
— | — | @@ -798,7 +793,7 @@ |
799 | 794 | |
800 | 795 | /** Get the virtual URL for a thumbnail file or directory */ |
801 | 796 | function getThumbVirtualUrl( $suffix = false ) { |
802 | | - $path = $this->repo->getVirtualUrl() . '/public/thumb/' . $this->getUrlRel(); |
| 797 | + $path = $this->repo->getVirtualUrl() . '/thumb/' . $this->getUrlRel(); |
803 | 798 | if ( $suffix !== false ) { |
804 | 799 | $path .= '/' . rawurlencode( $suffix ); |
805 | 800 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | * |
206 | 206 | * name A unique name for the repository. |
207 | 207 | * |
208 | | - * For all core repos: |
| 208 | + * For most core repos: |
209 | 209 | * url Base public URL |
210 | 210 | * hashLevels The number of directory levels for hash-based division of files |
211 | 211 | * thumbScriptUrl The URL for thumb.php (optional, not recommended) |
— | — | @@ -220,7 +220,12 @@ |
221 | 221 | * placeholders. Default for LocalRepo is 'simple'. |
222 | 222 | * fileMode This allows wikis to set the file mode when uploading/moving files. Default |
223 | 223 | * is 0644. |
| 224 | + * directory The local filesystem directory where public files are stored. Not used for |
| 225 | + * some remote repos. |
| 226 | + * thumbDir The base thumbnail directory. Defaults to <directory>/thumb. |
| 227 | + * thumbUrl The base thumbnail URL. Defaults to <url>/thumb. |
224 | 228 | * |
| 229 | + * |
225 | 230 | * These settings describe a foreign MediaWiki installation. They are optional, and will be ignored |
226 | 231 | * for local repositories: |
227 | 232 | * descBaseUrl URL of image description pages, e.g. http://en.wikipedia.org/wiki/Image: |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -143,6 +143,8 @@ |
144 | 144 | display for old versions of images. |
145 | 145 | * In watchlists and Special:RecentChanges, the difference in page size now |
146 | 146 | appears in dark green if bytes were added and dark red if bytes were removed. |
| 147 | +* Added FSRepo configuration properties thumbUrl and thumbDir, to allow the |
| 148 | + thumbnails to be stored in a separate location to the source images. |
147 | 149 | |
148 | 150 | === Bug fixes in 1.16 === |
149 | 151 | |