2007-06-16 02:55:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base class for file repositories
|
|
|
|
|
* Do not instantiate, use a derived class.
|
|
|
|
|
*/
|
|
|
|
|
abstract class FileRepo {
|
|
|
|
|
const DELETE_SOURCE = 1;
|
2008-03-09 03:10:28 +00:00
|
|
|
const FIND_PRIVATE = 1;
|
2008-05-08 20:15:09 +00:00
|
|
|
const FIND_IGNORE_REDIRECT = 2;
|
2007-07-22 14:45:12 +00:00
|
|
|
const OVERWRITE = 2;
|
|
|
|
|
const OVERWRITE_SAME = 4;
|
2007-06-16 02:55:25 +00:00
|
|
|
|
|
|
|
|
var $thumbScriptUrl, $transformVia404;
|
|
|
|
|
var $descBaseUrl, $scriptDirUrl, $articleUrl, $fetchDescription, $initialCapital;
|
2007-07-22 14:45:12 +00:00
|
|
|
var $pathDisclosureProtection = 'paranoid';
|
2007-06-16 02:55:25 +00:00
|
|
|
|
2008-04-14 07:45:50 +00:00
|
|
|
/**
|
2007-06-16 02:55:25 +00:00
|
|
|
* Factory functions for creating new files
|
|
|
|
|
* Override these in the base class
|
|
|
|
|
*/
|
|
|
|
|
var $fileFactory = false, $oldFileFactory = false;
|
|
|
|
|
|
|
|
|
|
function __construct( $info ) {
|
|
|
|
|
// Required settings
|
|
|
|
|
$this->name = $info['name'];
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-06-16 02:55:25 +00:00
|
|
|
// Optional settings
|
|
|
|
|
$this->initialCapital = true; // by default
|
2008-04-14 07:45:50 +00:00
|
|
|
foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription',
|
|
|
|
|
'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection' ) as $var )
|
2007-06-16 02:55:25 +00:00
|
|
|
{
|
|
|
|
|
if ( isset( $info[$var] ) ) {
|
|
|
|
|
$this->$var = $info[$var];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$this->transformVia404 = !empty( $info['transformVia404'] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determine if a string is an mwrepo:// URL
|
|
|
|
|
*/
|
|
|
|
|
static function isVirtualUrl( $url ) {
|
|
|
|
|
return substr( $url, 0, 9 ) == 'mwrepo://';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new File object from the local repository
|
|
|
|
|
* @param mixed $title Title object or string
|
2008-04-14 07:45:50 +00:00
|
|
|
* @param mixed $time Time at which the image was uploaded.
|
|
|
|
|
* If this is specified, the returned object will be an
|
2007-06-16 02:55:25 +00:00
|
|
|
* instance of the repository's old file class instead of
|
2008-04-14 07:45:50 +00:00
|
|
|
* a current file. Repositories not supporting version
|
2007-06-16 02:55:25 +00:00
|
|
|
* control should return false if this parameter is set.
|
|
|
|
|
*/
|
|
|
|
|
function newFile( $title, $time = false ) {
|
|
|
|
|
if ( !($title instanceof Title) ) {
|
|
|
|
|
$title = Title::makeTitleSafe( NS_IMAGE, $title );
|
|
|
|
|
if ( !is_object( $title ) ) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( $time ) {
|
|
|
|
|
if ( $this->oldFileFactory ) {
|
|
|
|
|
return call_user_func( $this->oldFileFactory, $title, $this, $time );
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return call_user_func( $this->fileFactory, $title, $this );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-04-05 15:38:08 +00:00
|
|
|
* Find an instance of the named file created at the specified time
|
2008-04-14 07:45:50 +00:00
|
|
|
* Returns false if the file does not exist. Repositories not supporting
|
2007-06-16 02:55:25 +00:00
|
|
|
* version control should return false if the time is specified.
|
|
|
|
|
*
|
2008-04-06 10:18:47 +00:00
|
|
|
* @param mixed $title Title object or string
|
2007-06-16 02:55:25 +00:00
|
|
|
* @param mixed $time 14-character timestamp, or false for the current version
|
|
|
|
|
*/
|
2008-03-09 03:10:28 +00:00
|
|
|
function findFile( $title, $time = false, $flags = 0 ) {
|
2008-04-06 10:18:47 +00:00
|
|
|
if ( !($title instanceof Title) ) {
|
|
|
|
|
$title = Title::makeTitleSafe( NS_IMAGE, $title );
|
|
|
|
|
if ( !is_object( $title ) ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-06-16 02:55:25 +00:00
|
|
|
# First try the current version of the file to see if it precedes the timestamp
|
|
|
|
|
$img = $this->newFile( $title );
|
2007-10-01 19:50:25 +00:00
|
|
|
if ( !$img ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2008-02-04 08:18:55 +00:00
|
|
|
if ( $img->exists() && ( !$time || $img->getTimestamp() == $time ) ) {
|
2007-06-16 02:55:25 +00:00
|
|
|
return $img;
|
|
|
|
|
}
|
|
|
|
|
# Now try an old version of the file
|
2008-05-07 03:39:35 +00:00
|
|
|
if ( $time !== false ) {
|
|
|
|
|
$img = $this->newFile( $title, $time );
|
|
|
|
|
if ( $img->exists() ) {
|
|
|
|
|
if ( !$img->isDeleted(File::DELETED_FILE) ) {
|
|
|
|
|
return $img;
|
|
|
|
|
} else if ( ($flags & FileRepo::FIND_PRIVATE) && $img->userCan(File::DELETED_FILE) ) {
|
|
|
|
|
return $img;
|
|
|
|
|
}
|
2008-03-09 03:10:28 +00:00
|
|
|
}
|
2007-06-16 02:55:25 +00:00
|
|
|
}
|
2008-05-08 20:15:09 +00:00
|
|
|
|
2008-01-16 18:27:43 +00:00
|
|
|
# Now try redirects
|
2008-05-08 20:15:09 +00:00
|
|
|
if ( $flags & FileRepo::FIND_IGNORE_REDIRECT ) return false;
|
|
|
|
|
$redir = $this->checkRedirect( $title );
|
2008-01-20 07:05:59 +00:00
|
|
|
if( $redir && $redir->getNamespace() == NS_IMAGE) {
|
2008-01-16 18:27:43 +00:00
|
|
|
$img = $this->newFile( $redir );
|
|
|
|
|
if( !$img ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if( $img->exists() ) {
|
|
|
|
|
$img->redirectedFrom( $title->getText() );
|
|
|
|
|
return $img;
|
|
|
|
|
}
|
|
|
|
|
}
|
2008-03-09 03:10:28 +00:00
|
|
|
return false;
|
2007-06-16 02:55:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the URL of thumb.php
|
|
|
|
|
*/
|
|
|
|
|
function getThumbScriptUrl() {
|
|
|
|
|
return $this->thumbScriptUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if the repository can transform files via a 404 handler
|
|
|
|
|
*/
|
|
|
|
|
function canTransformVia404() {
|
|
|
|
|
return $this->transformVia404;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the name of an image from its title object
|
|
|
|
|
*/
|
|
|
|
|
function getNameFromTitle( $title ) {
|
|
|
|
|
global $wgCapitalLinks;
|
|
|
|
|
if ( $this->initialCapital != $wgCapitalLinks ) {
|
|
|
|
|
global $wgContLang;
|
|
|
|
|
$name = $title->getUserCaseDBKey();
|
|
|
|
|
if ( $this->initialCapital ) {
|
|
|
|
|
$name = $wgContLang->ucfirst( $name );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$name = $title->getDBkey();
|
|
|
|
|
}
|
|
|
|
|
return $name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static function getHashPathForLevel( $name, $levels ) {
|
|
|
|
|
if ( $levels == 0 ) {
|
|
|
|
|
return '';
|
|
|
|
|
} else {
|
|
|
|
|
$hash = md5( $name );
|
|
|
|
|
$path = '';
|
|
|
|
|
for ( $i = 1; $i <= $levels; $i++ ) {
|
|
|
|
|
$path .= substr( $hash, 0, $i ) . '/';
|
|
|
|
|
}
|
|
|
|
|
return $path;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the name of this repository, as specified by $info['name]' to the constructor
|
|
|
|
|
*/
|
|
|
|
|
function getName() {
|
|
|
|
|
return $this->name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the file description page base URL, or false if there isn't one.
|
|
|
|
|
* @private
|
|
|
|
|
*/
|
|
|
|
|
function getDescBaseUrl() {
|
|
|
|
|
if ( is_null( $this->descBaseUrl ) ) {
|
|
|
|
|
if ( !is_null( $this->articleUrl ) ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$this->descBaseUrl = str_replace( '$1',
|
2008-03-21 23:13:34 +00:00
|
|
|
wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) ) . ':', $this->articleUrl );
|
2007-06-16 02:55:25 +00:00
|
|
|
} elseif ( !is_null( $this->scriptDirUrl ) ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
$this->descBaseUrl = $this->scriptDirUrl . '/index.php?title=' .
|
2008-03-21 23:13:34 +00:00
|
|
|
wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) ) . ':';
|
2007-06-16 02:55:25 +00:00
|
|
|
} else {
|
|
|
|
|
$this->descBaseUrl = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $this->descBaseUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get the URL of an image description page. May return false if it is
|
2008-04-14 07:45:50 +00:00
|
|
|
* unknown or not applicable. In general this should only be called by the
|
|
|
|
|
* File class, since it may return invalid results for certain kinds of
|
2007-06-16 02:55:25 +00:00
|
|
|
* repositories. Use File::getDescriptionUrl() in user code.
|
|
|
|
|
*
|
|
|
|
|
* In particular, it uses the article paths as specified to the repository
|
|
|
|
|
* constructor, whereas local repositories use the local Title functions.
|
|
|
|
|
*/
|
|
|
|
|
function getDescriptionUrl( $name ) {
|
|
|
|
|
$base = $this->getDescBaseUrl();
|
|
|
|
|
if ( $base ) {
|
|
|
|
|
return $base . wfUrlencode( $name );
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2008-04-14 07:45:50 +00:00
|
|
|
* Get the URL of the content-only fragment of the description page. For
|
|
|
|
|
* MediaWiki this means action=render. This should only be called by the
|
|
|
|
|
* repository's file class, since it may return invalid results. User code
|
2007-06-16 02:55:25 +00:00
|
|
|
* should use File::getDescriptionText().
|
|
|
|
|
*/
|
|
|
|
|
function getDescriptionRenderUrl( $name ) {
|
|
|
|
|
if ( isset( $this->scriptDirUrl ) ) {
|
2008-04-14 07:45:50 +00:00
|
|
|
return $this->scriptDirUrl . '/index.php?title=' .
|
2008-03-21 23:13:34 +00:00
|
|
|
wfUrlencode( MWNamespace::getCanonicalName( NS_IMAGE ) . ':' . $name ) .
|
2007-06-16 02:55:25 +00:00
|
|
|
'&action=render';
|
|
|
|
|
} else {
|
|
|
|
|
$descBase = $this->getDescBaseUrl();
|
|
|
|
|
if ( $descBase ) {
|
|
|
|
|
return wfAppendQuery( $descBase . wfUrlencode( $name ), 'action=render' );
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Store a file to a given destination.
|
2007-07-22 14:45:12 +00:00
|
|
|
*
|
|
|
|
|
* @param string $srcPath Source path or virtual URL
|
|
|
|
|
* @param string $dstZone Destination zone
|
|
|
|
|
* @param string $dstRel Destination relative path
|
|
|
|
|
* @param integer $flags Bitwise combination of the following flags:
|
|
|
|
|
* self::DELETE_SOURCE Delete the source file after upload
|
|
|
|
|
* self::OVERWRITE Overwrite an existing destination file instead of failing
|
2008-04-14 07:45:50 +00:00
|
|
|
* self::OVERWRITE_SAME Overwrite the file if the destination exists and has the
|
2007-07-22 14:45:12 +00:00
|
|
|
* same contents as the source
|
|
|
|
|
* @return FileRepoStatus
|
|
|
|
|
*/
|
|
|
|
|
function store( $srcPath, $dstZone, $dstRel, $flags = 0 ) {
|
|
|
|
|
$status = $this->storeBatch( array( array( $srcPath, $dstZone, $dstRel ) ), $flags );
|
|
|
|
|
if ( $status->successCount == 0 ) {
|
|
|
|
|
$status->ok = false;
|
|
|
|
|
}
|
|
|
|
|
return $status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Store a batch of files
|
|
|
|
|
*
|
|
|
|
|
* @param array $triplets (src,zone,dest) triplets as per store()
|
|
|
|
|
* @param integer $flags Flags as per store
|
2007-06-16 02:55:25 +00:00
|
|
|
*/
|
2007-07-22 14:45:12 +00:00
|
|
|
abstract function storeBatch( $triplets, $flags = 0 );
|
2007-06-16 02:55:25 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Pick a random name in the temp zone and store a file to it.
|
2007-07-22 14:45:12 +00:00
|
|
|
* Returns a FileRepoStatus object with the URL in the value.
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* @param string $originalName The base name of the file as specified
|
2007-06-16 02:55:25 +00:00
|
|
|
* by the user. The file extension will be maintained.
|
|
|
|
|
* @param string $srcPath The current location of the file.
|
|
|
|
|
*/
|
|
|
|
|
abstract function storeTemp( $originalName, $srcPath );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Remove a temporary file or mark it for garbage collection
|
|
|
|
|
* @param string $virtualUrl The virtual URL returned by storeTemp
|
|
|
|
|
* @return boolean True on success, false on failure
|
|
|
|
|
* STUB
|
|
|
|
|
*/
|
|
|
|
|
function freeTemp( $virtualUrl ) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Copy or move a file either from the local filesystem or from an mwrepo://
|
|
|
|
|
* virtual URL, into this repository at the specified destination location.
|
|
|
|
|
*
|
2007-07-22 14:45:12 +00:00
|
|
|
* Returns a FileRepoStatus object. On success, the value contains "new" or
|
2008-04-14 07:45:50 +00:00
|
|
|
* "archived", to indicate whether the file was new with that name.
|
2007-07-22 14:45:12 +00:00
|
|
|
*
|
2007-06-16 02:55:25 +00:00
|
|
|
* @param string $srcPath The source path or URL
|
|
|
|
|
* @param string $dstRel The destination relative path
|
|
|
|
|
* @param string $archiveRel The relative path where the existing file is to
|
|
|
|
|
* be archived, if there is one. Relative to the public zone root.
|
|
|
|
|
* @param integer $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate
|
|
|
|
|
* that the source file should be deleted if possible
|
|
|
|
|
*/
|
2007-07-22 14:45:12 +00:00
|
|
|
function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
|
|
|
|
|
$status = $this->publishBatch( array( array( $srcPath, $dstRel, $archiveRel ) ), $flags );
|
|
|
|
|
if ( $status->successCount == 0 ) {
|
|
|
|
|
$status->ok = false;
|
|
|
|
|
}
|
|
|
|
|
if ( isset( $status->value[0] ) ) {
|
|
|
|
|
$status->value = $status->value[0];
|
|
|
|
|
} else {
|
|
|
|
|
$status->value = false;
|
|
|
|
|
}
|
|
|
|
|
return $status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Publish a batch of files
|
|
|
|
|
* @param array $triplets (source,dest,archive) triplets as per publish()
|
|
|
|
|
* @param integer $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate
|
|
|
|
|
* that the source files should be deleted if possible
|
|
|
|
|
*/
|
|
|
|
|
abstract function publishBatch( $triplets, $flags = 0 );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Move a group of files to the deletion archive.
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* If no valid deletion archive is configured, this may either delete the
|
2007-07-22 14:45:12 +00:00
|
|
|
* file or throw an exception, depending on the preference of the repository.
|
|
|
|
|
*
|
|
|
|
|
* The overwrite policy is determined by the repository -- currently FSRepo
|
2008-04-14 07:45:50 +00:00
|
|
|
* assumes a naming scheme in the deleted zone based on content hash, as
|
2007-07-22 14:45:12 +00:00
|
|
|
* opposed to the public zone which is assumed to be unique.
|
|
|
|
|
*
|
2008-04-14 07:45:50 +00:00
|
|
|
* @param array $sourceDestPairs Array of source/destination pairs. Each element
|
2007-07-22 14:45:12 +00:00
|
|
|
* is a two-element array containing the source file path relative to the
|
2008-04-14 07:45:50 +00:00
|
|
|
* public root in the first element, and the archive file path relative
|
2007-07-22 14:45:12 +00:00
|
|
|
* to the deleted zone root in the second element.
|
|
|
|
|
* @return FileRepoStatus
|
|
|
|
|
*/
|
|
|
|
|
abstract function deleteBatch( $sourceDestPairs );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Move a file to the deletion archive.
|
2008-04-14 07:45:50 +00:00
|
|
|
* If no valid deletion archive exists, this may either delete the file
|
2007-07-22 14:45:12 +00:00
|
|
|
* or throw an exception, depending on the preference of the repository
|
|
|
|
|
* @param mixed $srcRel Relative path for the file to be deleted
|
2008-04-14 07:45:50 +00:00
|
|
|
* @param mixed $archiveRel Relative path for the archive location.
|
2007-07-22 14:45:12 +00:00
|
|
|
* Relative to a private archive directory.
|
|
|
|
|
* @return WikiError object (wikitext-formatted), or true for success
|
|
|
|
|
*/
|
|
|
|
|
function delete( $srcRel, $archiveRel ) {
|
|
|
|
|
return $this->deleteBatch( array( array( $srcRel, $archiveRel ) ) );
|
|
|
|
|
}
|
2007-06-16 02:55:25 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get properties of a file with a given virtual URL
|
|
|
|
|
* The virtual URL must refer to this repo
|
|
|
|
|
* Properties should ultimately be obtained via File::getPropsFromPath()
|
|
|
|
|
*/
|
|
|
|
|
abstract function getFileProps( $virtualUrl );
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Call a callback function for every file in the repository
|
|
|
|
|
* May use either the database or the filesystem
|
|
|
|
|
* STUB
|
|
|
|
|
*/
|
|
|
|
|
function enumFiles( $callback ) {
|
|
|
|
|
throw new MWException( 'enumFiles is not supported by ' . get_class( $this ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Determine if a relative path is valid, i.e. not blank or involving directory traveral
|
|
|
|
|
*/
|
|
|
|
|
function validateFilename( $filename ) {
|
|
|
|
|
if ( strval( $filename ) == '' ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if ( wfIsWindows() ) {
|
|
|
|
|
$filename = strtr( $filename, '\\', '/' );
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Use the same traversal protection as Title::secureAndSplit()
|
|
|
|
|
*/
|
|
|
|
|
if ( strpos( $filename, '.' ) !== false &&
|
|
|
|
|
( $filename === '.' || $filename === '..' ||
|
|
|
|
|
strpos( $filename, './' ) === 0 ||
|
|
|
|
|
strpos( $filename, '../' ) === 0 ||
|
|
|
|
|
strpos( $filename, '/./' ) !== false ||
|
|
|
|
|
strpos( $filename, '/../' ) !== false ) )
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-07-22 14:45:12 +00:00
|
|
|
|
|
|
|
|
/**#@+
|
|
|
|
|
* Path disclosure protection functions
|
|
|
|
|
*/
|
|
|
|
|
function paranoidClean( $param ) { return '[hidden]'; }
|
|
|
|
|
function passThrough( $param ) { return $param; }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get a callback function to use for cleaning error message parameters
|
|
|
|
|
*/
|
|
|
|
|
function getErrorCleanupFunction() {
|
|
|
|
|
switch ( $this->pathDisclosureProtection ) {
|
|
|
|
|
case 'none':
|
|
|
|
|
$callback = array( $this, 'passThrough' );
|
|
|
|
|
break;
|
|
|
|
|
default: // 'paranoid'
|
|
|
|
|
$callback = array( $this, 'paranoidClean' );
|
|
|
|
|
}
|
|
|
|
|
return $callback;
|
|
|
|
|
}
|
|
|
|
|
/**#@-*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new fatal error
|
|
|
|
|
*/
|
|
|
|
|
function newFatal( $message /*, parameters...*/ ) {
|
|
|
|
|
$params = func_get_args();
|
|
|
|
|
array_unshift( $params, $this );
|
|
|
|
|
return call_user_func_array( array( 'FileRepoStatus', 'newFatal' ), $params );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new good result
|
|
|
|
|
*/
|
|
|
|
|
function newGood( $value = null ) {
|
|
|
|
|
return FileRepoStatus::newGood( $this, $value );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delete files in the deleted directory if they are not referenced in the filearchive table
|
|
|
|
|
* STUB
|
|
|
|
|
*/
|
|
|
|
|
function cleanupDeletedBatch( $storageKeys ) {}
|
2008-01-16 18:27:43 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Checks if there is a redirect named as $title
|
|
|
|
|
* STUB
|
|
|
|
|
*
|
|
|
|
|
* @param Title $title Title of image
|
|
|
|
|
*/
|
|
|
|
|
function checkRedirect( $title ) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2008-04-12 18:04:46 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Invalidates image redirect cache related to that image
|
|
|
|
|
* STUB
|
|
|
|
|
*
|
|
|
|
|
* @param Title $title Title of image
|
|
|
|
|
*/
|
|
|
|
|
function invalidateImageRedirect( $title ) {
|
|
|
|
|
}
|
2007-06-16 02:55:25 +00:00
|
|
|
}
|