* Move the generic getHashPath accessor up a level to the FileRepo.
$wgDefaultSkin.
* Added $wgEnotifUseRealName, which allows UserMailer to send out e-mails based
on the user's real name if one is set. Defaults to false (use the username)
+* Removed the 'apiThumbCacheDir' option from $wgForeignFileRepos (only used in
+ ForeignAPIRepo)
=== Migrated extensions ===
The following extensions are migrated into MediaWiki 1.14:
* (bug 5101) Image from Commons doesn't show up when searched in Wikipedia search box
* (bug 4362) [[MediaWiki:History copyright]] no more used with most recent
revision when passing oldid parameter in the url
-* (bug 16265) When caching thumbs with the ForeignApiRepo, we now use the same filename
- as the remote site.
+* (bug 16265) When caching thumbs with the ForeignApiRepo, we now use the same
+ filename as the remote site.
* (bug 8345) Don't autosummarize where a redirect was left unchanged
+* Made thumb caching in ForeignApiFile objects integrated with normal thumb path
+ naming (/thumbs/hash/file), retired 'apiThumbCacheDir' as a result.
=== API changes in 1.14 ===
* @ingroup FileRepo
*/
class FSRepo extends FileRepo {
- var $directory, $deletedDir, $url, $hashLevels, $deletedHashLevels;
+ var $directory, $deletedDir, $url, $deletedHashLevels;
var $fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' );
var $oldFileFactory = false;
var $pathDisclosureProtection = 'simple';
return $status;
}
- /**
- * Get a relative path including trailing slash, e.g. f/fa/
- * If the repo is not hashed, returns an empty string
- */
- function getHashPath( $name ) {
- return FileRepo::getHashPathForLevel( $name, $this->hashLevels );
- }
-
/**
* Get a relative path for a deletion archive key,
* e.g. s/z/a/ for sza251lrxrc1jad41h5mgilp8nysje52.jpg
var $thumbScriptUrl, $transformVia404;
var $descBaseUrl, $scriptDirUrl, $articleUrl, $fetchDescription, $initialCapital;
var $pathDisclosureProtection = 'paranoid';
- var $descriptionCacheExpiry, $apiThumbCacheExpiry, $apiThumbCacheDir;
+ var $descriptionCacheExpiry, $apiThumbCacheExpiry, $hashLevels;
/**
* Factory functions for creating new files
$this->initialCapital = true; // by default
foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection',
- 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'apiThumbCacheDir' ) as $var )
+ 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'hashLevels' ) as $var )
{
if ( isset( $info[$var] ) ) {
$this->$var = $info[$var];
return $path;
}
}
+
+ /**
+ * Get a relative path including trailing slash, e.g. f/fa/
+ * If the repo is not hashed, returns an empty string
+ */
+ function getHashPath( $name ) {
+ return self::getHashPathForLevel( $name, $this->hashLevels );
+ }
/**
* Get the name of this repository, as specified by $info['name]' to the constructor
* Only useful if we're locally caching thumbs anyway...
*/
function getThumbPath( $suffix = '' ) {
- $ret = null;
if ( $this->repo->canCacheThumbs() ) {
global $wgUploadDirectory;
- $path = $wgUploadDirectory . '/' . $this->repo->apiThumbCacheDir . '/' . $this->repo->name . '/';
+ $path = $wgUploadDirectory . '/thumb/' . $this->getHashPath( $this->getName() );
if ( $suffix ) {
$path = $path . $suffix . '/';
}
}
}
+/**
+ * No-ops
+ */
function storeBatch( $triplets, $flags = 0 ) {
return false;
}
-
function storeTemp( $originalName, $srcPath ) {
return false;
}
// We need the same filename as the remote one :)
$fileName = ltrim( substr( $foreignUrl, strrpos( $foreignUrl, '/' ),
strlen ( $foreignUrl ) ), '/' );
- $path = $this->apiThumbCacheDir . '/' .
- $name . '/';
+ $path = 'thumb/' . $this->getHashPath( $this->getName() );
if ( !is_dir($wgUploadDirectory . '/' . $path) ) {
wfMkdirParents($wgUploadDirectory . '/' . $path);
}
* @return bool
*/
public function canCacheThumbs() {
- return ( $this->apiThumbCacheExpiry > 0 && $this->apiThumbCacheDir );
+ return ( $this->apiThumbCacheExpiry > 0 );
}
}