* private: If true, return restricted (deleted) files if the current
* user is allowed to view them. Otherwise, such files will not
* be found. If a User object, use that user instead of the current.
+ * latest: If true, load from the latest available data into File objects
* @return File|bool False on failure
*/
public function findFile( $title, $options = array() ) {
if ( !$title ) {
return false;
}
+ if ( isset( $options['bypassCache'] ) ) {
+ $options['latest'] = $options['bypassCache']; // b/c
+ }
$time = isset( $options['time'] ) ? $options['time'] : false;
+ $flags = !empty( $options['latest'] ) ? File::READ_LATEST : 0;
# First try the current version of the file to see if it precedes the timestamp
$img = $this->newFile( $title );
if ( !$img ) {
return false;
}
+ $img->load( $flags );
if ( $img->exists() && ( !$time || $img->getTimestamp() == $time ) ) {
return $img;
}
# Now try an old version of the file
if ( $time !== false ) {
$img = $this->newFile( $title, $time );
+ $img->load( $flags );
if ( $img && $img->exists() ) {
if ( !$img->isDeleted( File::DELETED_FILE ) ) {
return $img; // always OK
$redir = $this->checkRedirect( $title );
if ( $redir && $title->getNamespace() == NS_FILE ) {
$img = $this->newFile( $redir );
+ $img->load( $flags );
if ( !$img ) {
return false;
}
* @return Status
*/
public function newGood( $value = null ) {
- $status = Status::newGood( $this, $value );
+ $status = Status::newGood( $value );
$status->cleanCallback = $this->getErrorCleanupFunction();
return $status;