wiki.techinc.nl/includes/filerepo/ForeignDBFile.php
Tim Starling 6cba5762b7 Bug 19240 (bad image list performance regression):
* Don't connect to the commons DB on cache hits, in order to determine the cache key name. Removed remnants of that bright idea from GlobalFunctions.php.
* Fixed total failure of negative caching in checkRedirect() due to memcached stripping trailing spaces from string values. Probably never worked.

Also:
* Respect hasSharedCache in foreign repos. Recently-added code was apparently ignorant of this setting.
* Renamed getMemcKey() to getSharedCacheKey() to make its function more clear, introduced getLocalCacheKey() to do the other thing. Fixed its parameters to be like wfMemcKey() and used it in more places.
* Used getLocalCacheKey() in various places instead of wfMemc(), to avoid having multiple repositories overwrite each others' caches. 
* Fixed the BagOStuff bug that the FIXME in LocalRepo::checkRedirect() appears to refer to.
* Removed getMasterDB() and getSlaveDB() from FileRepo, it's incorrect to assume that a repo other than a LocalRepo has an associated database.
* Made FileRepo::invalidateImageRedirect() a stub, to match FileRepo::checkRedirect(). Moved the functionality to LocalRepo where checkRedirect() is concretely implemented.
2009-06-17 07:31:00 +00:00

49 lines
1.1 KiB
PHP

<?php
/**
* @ingroup FileRepo
*/
class ForeignDBFile extends LocalFile {
static function newFromTitle( $title, $repo, $unused = null ) {
return new self( $title, $repo );
}
/**
* Create a ForeignDBFile from a title
* Do not call this except from inside a repo class.
*/
static function newFromRow( $row, $repo ) {
$title = Title::makeTitle( NS_FILE, $row->img_name );
$file = new self( $title, $repo );
$file->loadFromRow( $row );
return $file;
}
function publish( $srcPath, $flags = 0 ) {
$this->readOnlyError();
}
function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
$watch = false, $timestamp = false ) {
$this->readOnlyError();
}
function restore( $versions = array(), $unsuppress = false ) {
$this->readOnlyError();
}
function delete( $reason, $suppress = false ) {
$this->readOnlyError();
}
function move( $target ) {
$this->readOnlyError();
}
function getDescriptionUrl() {
// Restore remote behaviour
return File::getDescriptionUrl();
}
function getDescriptionText() {
// Restore remote behaviour
return File::getDescriptionText();
}
}