MediaWiki  REL1_19
OldLocalFile Class Reference

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

Inheritance diagram for OldLocalFile:
Collaboration diagram for OldLocalFile:

List of all members.

Public Member Functions

 __construct ($title, $repo, $time, $archiveName)
 getArchiveName ()
 getCacheFields ($prefix= 'img_')
 getCacheKey ()
 Get the memcached key for the main data for this file, or false if there is no access to the shared cache.
 getRel ()
 Get the path of the file relative to the public zone root.
 getUrlRel ()
 Get urlencoded path of the file relative to the public zone root.
 getVisibility ()
 Returns bitfield value.
 isDeleted ($field)
 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.
 recordOldUpload ($srcPath, $archiveName, $timestamp, $comment, $user)
 Record a file upload in the oldimage table, without adding log entries.
 upgradeRow ()
 Fix assorted version-related problems with the image row by reloading it from the file.
 uploadOld ($srcPath, $archiveName, $timestamp, $comment, $user, $flags=0)
 Upload a file directly into archive.
 userCan ($field, User $user=null)
 Determine if the current user is allowed to view a particular field of this image file, if it's marked as deleted.

Static Public Member Functions

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

Public Attributes

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

Detailed Description

Class to represent a file in the oldimage table.

Definition at line 14 of file OldLocalFile.php.


Constructor & Destructor Documentation

OldLocalFile::__construct ( title,
repo,
time,
archiveName 
)
Parameters:
$titleTitle
$repoFileRepo
$timeString: timestamp or null to load by archive name
$archiveNameString: archive name or null to load by timestamp

Definition at line 95 of file OldLocalFile.php.

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


Member Function Documentation

Definition at line 108 of file OldLocalFile.php.

References LocalFile\load().

Referenced by getRel(), and getUrlRel().

Here is the call graph for this function:

Here is the caller graph for this function:

OldLocalFile::getCacheFields ( prefix = 'img_')

Reimplemented from LocalFile.

Definition at line 143 of file OldLocalFile.php.

Referenced by loadFromDB().

Here is the caller graph for this function:

Get the memcached key for the main data for this file, or false if there is no access to the shared cache.

Reimplemented from LocalFile.

Definition at line 104 of file OldLocalFile.php.

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

This function is overriden in OldLocalFile to be like getArchiveRel().

Returns:
string

Reimplemented from File.

Definition at line 150 of file OldLocalFile.php.

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

Referenced by recordOldUpload().

Here is the call graph for this function:

Here is the caller graph for this function:

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

This function is overriden in OldLocalFile to be like getArchiveUrl().

Returns:
string

Reimplemented from File.

Definition at line 154 of file OldLocalFile.php.

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

Here is the call graph for this function:

Returns bitfield value.

Returns:
int

Reimplemented from File.

Definition at line 205 of file OldLocalFile.php.

References LocalFile\load().

Here is the call graph for this function:

Parameters:
$fieldInteger: one of DELETED_* bitfield constants for file or revision rows
Returns:
bool

Reimplemented from File.

Definition at line 196 of file OldLocalFile.php.

References LocalFile\load().

Referenced by isVisible().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns true if the image is an old version STUB.

Returns:
bool

Reimplemented from File.

Definition at line 115 of file OldLocalFile.php.

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.

Reimplemented from File.

Definition at line 119 of file OldLocalFile.php.

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

Here is the call graph for this function:

Load file metadata from the DB.

Reimplemented from LocalFile.

Definition at line 123 of file OldLocalFile.php.

References $dbr, getCacheFields(), File\getName(), LocalFile\loadFromRow(), wfProfileIn(), and wfProfileOut().

Here is the call graph for this function:

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

Definition at line 28 of file OldLocalFile.php.

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

Referenced by WikiRevision\importUpload().

Here is the caller graph for this function:

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

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

Parameters:
$sha1string base-36 SHA-1
$repoLocalRepo
string | bool$timestampMW_timestamp (optional)
Returns:
bool|OldLocalFile

Reimplemented from LocalFile.

Definition at line 49 of file OldLocalFile.php.

References $dbr, File\$repo, LocalFile\$sha1, LocalFile\$timestamp, and newFromRow().

Here is the call graph for this function:

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

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

Parameters:
$row
$repo
Returns:
LocalFile

Reimplemented from LocalFile.

Definition at line 32 of file OldLocalFile.php.

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

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters:
$title
$repo
$unused
Returns:
LocalFile

Reimplemented from LocalFile.

Definition at line 20 of file OldLocalFile.php.

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

OldLocalFile::recordOldUpload ( srcPath,
archiveName,
timestamp,
comment,
user 
)

Record a file upload in the oldimage table, without adding log entries.

Parameters:
$srcPathstring File system path to the source file
$archiveNamestring The archive name of the file
$commentstring Upload comment
$userUser User who did this upload
Returns:
bool

Definition at line 260 of file OldLocalFile.php.

References $comment, LocalFile\$timestamp, LocalFile\$user, File\getName(), and getRel().

Referenced by uploadOld().

Here is the call graph for this function:

Here is the caller graph for this function:

static OldLocalFile::selectFields ( ) [static]

Fields in the oldimage table.

Reimplemented from LocalFile.

Definition at line 68 of file OldLocalFile.php.

Referenced by LocalFile\getHistory().

Here is the caller graph for this function:

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

Reimplemented from LocalFile.

Definition at line 158 of file OldLocalFile.php.

References File\getName(), LocalFile\loadFromFile(), File\splitMime(), wfDebug(), wfProfileIn(), and wfProfileOut().

Here is the call graph for this function:

OldLocalFile::uploadOld ( srcPath,
archiveName,
timestamp,
comment,
user,
flags = 0 
)

Upload a file directly into archive.

Generally for Special:Import.

Parameters:
$srcPathstring File system path of the source file
$archiveNamestring Full archive name of the file, in the form $timestamp!$filename, where $filename must match $this->getName()
Returns:
FileRepoStatus

Definition at line 232 of file OldLocalFile.php.

References $comment, LocalFile\$timestamp, LocalFile\$user, FileRepo\DELETE_SOURCE, File\DELETE_SOURCE, File\getHashPath(), LocalFile\lock(), LocalFile\publishTo(), recordOldUpload(), and LocalFile\unlock().

Here is the call graph for this function:

OldLocalFile::userCan ( field,
User user = null 
)

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

Parameters:
$fieldInteger
$userUser object to check, or null to use $wgUser
Returns:
bool

Reimplemented from File.

Definition at line 218 of file OldLocalFile.php.

References LocalFile\$user, LocalFile\load(), and Revision\userCanBitfield().

Here is the call graph for this function:


Member Data Documentation

OldLocalFile::$archive_name

Definition at line 15 of file OldLocalFile.php.

OldLocalFile::$requestedTime

Definition at line 15 of file OldLocalFile.php.

Definition at line 17 of file OldLocalFile.php.

Definition at line 18 of file OldLocalFile.php.


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