* Removed getThumbRel(), doesn't make sense in conjunction with above options. Not used by core or hosted extensions.
display for old versions of images.
* In watchlists and Special:RecentChanges, the difference in page size now
appears in dark green if bytes were added and dark red if bytes were removed.
+* Added FSRepo configuration properties thumbUrl and thumbDir, to allow the
+ thumbnails to be stored in a separate location to the source images.
=== Bug fixes in 1.16 ===
*
* name A unique name for the repository.
*
- * For all core repos:
+ * For most core repos:
* url Base public URL
* hashLevels The number of directory levels for hash-based division of files
* thumbScriptUrl The URL for thumb.php (optional, not recommended)
* placeholders. Default for LocalRepo is 'simple'.
* fileMode This allows wikis to set the file mode when uploading/moving files. Default
* is 0644.
+ * directory The local filesystem directory where public files are stored. Not used for
+ * some remote repos.
+ * thumbDir The base thumbnail directory. Defaults to <directory>/thumb.
+ * thumbUrl The base thumbnail URL. Defaults to <url>/thumb.
+ *
*
* These settings describe a foreign MediaWiki installation. They are optional, and will be ignored
* for local repositories:
$info['deletedHashLevels'] : $this->hashLevels;
$this->deletedDir = isset( $info['deletedDir'] ) ? $info['deletedDir'] : false;
$this->fileMode = isset( $info['fileMode'] ) ? $info['fileMode'] : 0644;
+ if ( isset( $info['thumbDir'] ) ) {
+ $this->thumbDir = $info['thumbDir'];
+ } else {
+ $this->thumbDir = "{$this->directory}/thumb";
+ }
+ if ( isset( $info['thumbUrl'] ) ) {
+ $this->thumbUrl = $info['thumbUrl'];
+ } else {
+ $this->thumbUrl = "{$this->url}/thumb";
+ }
}
/**
return "{$this->directory}/temp";
case 'deleted':
return $this->deletedDir;
+ case 'thumb':
+ return $this->thumbDir;
default:
return false;
}
return "{$this->url}/temp";
case 'deleted':
return false; // no public URL
+ case 'thumb':
+ return $this->thumbUrl;
default:
return false;
}
return $path;
}
- /** Get relative path for a thumbnail file */
- function getThumbRel( $suffix = false ) {
- $path = 'thumb/' . $this->getRel();
- if ( $suffix !== false ) {
- $path .= '/' . $suffix;
- }
- return $path;
- }
-
/** Get the path of the archive directory, or a particular file if $suffix is specified */
function getArchivePath( $suffix = false ) {
return $this->repo->getZonePath('public') . '/' . $this->getArchiveRel( $suffix );
/** Get the path of the thumbnail directory, or a particular file if $suffix is specified */
function getThumbPath( $suffix = false ) {
- return $this->repo->getZonePath('public') . '/' . $this->getThumbRel( $suffix );
+ $path = $this->repo->getZonePath('thumb') . '/' . $this->getRel();
+ if ( $suffix !== false ) {
+ $path .= '/' . $suffix;
+ }
+ return $path;
}
/** Get the URL of the archive directory, or a particular file if $suffix is specified */
/** Get the URL of the thumbnail directory, or a particular file if $suffix is specified */
function getThumbUrl( $suffix = false ) {
- $path = $this->repo->getZoneUrl('public') . '/thumb/' . $this->getUrlRel();
+ $path = $this->repo->getZoneUrl('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/thumb/' . $this->getUrlRel();
+ $path = $this->repo->getVirtualUrl() . '/thumb/' . $this->getUrlRel();
if ( $suffix !== false ) {
$path .= '/' . rawurlencode( $suffix );
}