OldLocalFile Class Reference
[FileRepo]

Class to represent a file in the oldimage table. More...

Inherits LocalFile.

List of all members.

Public Member Functions

 __construct ($title, $repo, $time, $archiveName)
 getCacheKey ()
 Get the memcached key.
 getArchiveName ()
 isOld ()
 Returns true if the image is an old version STUB.
 isVisible ()
 Returns true if file exists in the repository and can be included in a page.
 loadFromDB ()
 Load file metadata from the DB.
 getCacheFields ($prefix= 'img_')
 getRel ()
 Get the path of the file relative to the public zone root.
 getUrlRel ()
 Get urlencoded relative path of the file.
 upgradeRow ()
 Fix assorted version-related problems with the image row by reloading it from the file.
 isDeleted ($field)
 int $field one of DELETED_* bitfield constants for file or revision rows
 userCan ($field)
 Determine if the current user is allowed to view a particular field of this FileStore image file, if it's marked as deleted.

Static Public Member Functions

static newFromTitle ($title, $repo, $time=null)
 #@-
static newFromArchiveName ($title, $repo, $archiveName)
static newFromRow ($row, $repo)
 Create a LocalFile from a title Do not call this except from inside a repo class.
static newFromKey ($sha1, $repo, $timestamp=false)
 Create a LocalFile from a SHA-1 key Do not call this except from inside a repo class.
static selectFields ()
 Fields in the oldimage table.

Public Attributes

 $requestedTime
 $archive_name
const CACHE_VERSION = 1
const MAX_CACHE_ROWS = 20


Detailed Description

Class to represent a file in the oldimage table.

Definition at line 8 of file OldLocalFile.php.


Constructor & Destructor Documentation

OldLocalFile::__construct ( title,
repo,
time,
archiveName 
)

Parameters:
Title $title
FileRepo $repo
string $time Timestamp or null to load by archive name
string $archiveName Archive name or null to load by timestamp

Definition at line 78 of file OldLocalFile.php.

References File::$repo, and File::$title.


Member Function Documentation

OldLocalFile::getArchiveName (  ) 

Definition at line 91 of file OldLocalFile.php.

References LocalFile::load().

Referenced by getRel(), and getUrlRel().

OldLocalFile::getCacheFields ( prefix = 'img_'  ) 

Reimplemented from LocalFile.

Definition at line 126 of file OldLocalFile.php.

References $fields, and $prefix.

Referenced by loadFromDB(), and newFromKey().

OldLocalFile::getCacheKey (  ) 

Get the memcached key.

Reimplemented from LocalFile.

Definition at line 87 of file OldLocalFile.php.

OldLocalFile::getRel (  ) 

Get the path of the file relative to the public zone root.

Reimplemented from File.

Definition at line 133 of file OldLocalFile.php.

References getArchiveName(), and File::getHashPath().

OldLocalFile::getUrlRel (  ) 

Get urlencoded relative path of the file.

Reimplemented from File.

Definition at line 137 of file OldLocalFile.php.

References getArchiveName(), and File::getHashPath().

OldLocalFile::isDeleted ( field  ) 

int $field one of DELETED_* bitfield constants for file or revision rows

Returns:
bool

Reimplemented from File.

Definition at line 179 of file OldLocalFile.php.

Referenced by isVisible().

OldLocalFile::isOld (  ) 

Returns true if the image is an old version STUB.

Reimplemented from File.

Definition at line 98 of file OldLocalFile.php.

OldLocalFile::isVisible (  ) 

Returns true if file exists in the repository and can be included in a page.

It would be unsafe to include private images, making public thumbnails inadvertently

Returns:
boolean Whether file exists in the repository and is includable.
Access:
public

Reimplemented from File.

Definition at line 102 of file OldLocalFile.php.

References File::DELETED_FILE, LocalFile::exists(), and isDeleted().

OldLocalFile::loadFromDB (  ) 

Load file metadata from the DB.

Reimplemented from LocalFile.

Definition at line 106 of file OldLocalFile.php.

References $conds, $dbr, $row, getCacheFields(), File::getName(), LocalFile::loadFromRow(), wfProfileIn(), and wfProfileOut().

static OldLocalFile::newFromArchiveName ( title,
repo,
archiveName 
) [static]

Definition at line 21 of file OldLocalFile.php.

References File::$repo, and File::$title.

static OldLocalFile::newFromKey ( sha1,
repo,
timestamp = false 
) [static]

Create a LocalFile from a SHA-1 key Do not call this except from inside a repo class.

Reimplemented from LocalFile.

Definition at line 32 of file OldLocalFile.php.

References $conds, $dbr, $fname, File::$repo, $row, LocalFile::$sha1, LocalFile::$timestamp, getCacheFields(), and newFromRow().

static OldLocalFile::newFromRow ( row,
repo 
) [static]

Create a LocalFile from a title Do not call this except from inside a repo class.

Reimplemented from LocalFile.

Definition at line 25 of file OldLocalFile.php.

References $file, File::$repo, $row, File::$title, and Title::makeTitle().

Referenced by LocalFile::getHistory(), and newFromKey().

static OldLocalFile::newFromTitle ( title,
repo,
unused = null 
) [static]

#@-

Create a LocalFile from a title Do not call this except from inside a repo class.

Note: $unused param is only here to avoid an E_STRICT

Reimplemented from LocalFile.

Definition at line 14 of file OldLocalFile.php.

References File::$repo, and File::$title.

static OldLocalFile::selectFields (  )  [static]

Fields in the oldimage table.

Reimplemented from LocalFile.

Definition at line 51 of file OldLocalFile.php.

Referenced by LocalFile::getHistory().

OldLocalFile::upgradeRow (  ) 

Fix assorted version-related problems with the image row by reloading it from the file.

Reimplemented from LocalFile.

Definition at line 141 of file OldLocalFile.php.

References $dbw, $minor, File::getName(), LocalFile::loadFromFile(), File::splitMime(), wfDebug(), wfProfileIn(), and wfProfileOut().

OldLocalFile::userCan ( field  ) 

Determine if the current user is allowed to view a particular field of this FileStore image file, if it's marked as deleted.

Parameters:
int $field
Returns:
bool

Reimplemented from File.

Definition at line 189 of file OldLocalFile.php.

References $wgUser, File::DELETED_RESTRICTED, and wfDebug().


Member Data Documentation

OldLocalFile::$archive_name

Definition at line 9 of file OldLocalFile.php.

OldLocalFile::$requestedTime

Definition at line 9 of file OldLocalFile.php.

Definition at line 11 of file OldLocalFile.php.

Definition at line 12 of file OldLocalFile.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:43 2009 for MediaWiki by  doxygen 1.5.9