MediaWiki
REL1_20
|
Class to represent a file in the oldimage table. More...
Public Member Functions | |
__construct ($title, $repo, $time, $archiveName) | |
getArchiveName () | |
getCacheFields ($prefix= 'img_') | |
getCacheKey () | |
getRel () | |
getUrlRel () | |
getVisibility () | |
Returns bitfield value. | |
isDeleted ($field) | |
isOld () | |
isVisible () | |
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) |
static | newFromTitle ($title, $repo, $time=null) |
static | selectFields () |
Fields in the oldimage table. | |
Public Attributes | |
$archive_name | |
$requestedTime | |
const | CACHE_VERSION = 1 |
const | MAX_CACHE_ROWS = 20 |
Class to represent a file in the oldimage table.
Definition at line 29 of file OldLocalFile.php.
OldLocalFile::__construct | ( | $ | title, |
$ | repo, | ||
$ | time, | ||
$ | archiveName | ||
) |
$title | Title |
$repo | FileRepo |
$time | String: timestamp or null to load by archive name |
$archiveName | String: archive name or null to load by timestamp |
MWException |
Definition at line 130 of file OldLocalFile.php.
References LocalFile\$repo, and File\$title.
Definition at line 149 of file OldLocalFile.php.
References LocalFile\load().
Referenced by getRel(), and getUrlRel().
OldLocalFile::getCacheFields | ( | $ | prefix = 'img_' | ) |
$prefix | string |
Reimplemented from LocalFile.
Definition at line 194 of file OldLocalFile.php.
Referenced by loadFromDB().
Reimplemented from File.
Definition at line 204 of file OldLocalFile.php.
References getArchiveName(), and File\getHashPath().
Referenced by recordOldUpload().
Reimplemented from File.
Definition at line 211 of file OldLocalFile.php.
References getArchiveName(), and File\getHashPath().
Returns bitfield value.
Reimplemented from File.
Definition at line 263 of file OldLocalFile.php.
References LocalFile\load().
OldLocalFile::isDeleted | ( | $ | field | ) |
$field | Integer: one of DELETED_* bitfield constants for file or revision rows |
Reimplemented from File.
Definition at line 254 of file OldLocalFile.php.
References LocalFile\load().
Referenced by isVisible().
Reimplemented from File.
Definition at line 166 of file OldLocalFile.php.
References File\DELETED_FILE, LocalFile\exists(), and isDeleted().
Load file metadata from the DB.
Reimplemented from LocalFile.
Definition at line 170 of file OldLocalFile.php.
References $dbr, getCacheFields(), File\getName(), LocalFile\loadFromRow(), wfProfileIn(), and wfProfileOut().
static OldLocalFile::newFromArchiveName | ( | $ | title, |
$ | repo, | ||
$ | archiveName | ||
) | [static] |
Definition at line 56 of file OldLocalFile.php.
References LocalFile\$repo, and File\$title.
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.
$sha1 | string base-36 SHA-1 | |
$repo | LocalRepo | |
string | bool | $timestamp | MW_timestamp (optional) |
Reimplemented from LocalFile.
Definition at line 82 of file OldLocalFile.php.
References $dbr, LocalFile\$repo, LocalFile\$sha1, LocalFile\$timestamp, LocalRepo\getSlaveDB(), and newFromRow().
static OldLocalFile::newFromRow | ( | $ | row, |
$ | repo | ||
) | [static] |
$row | |
$repo | FileRepo |
Reimplemented from LocalFile.
Definition at line 65 of file OldLocalFile.php.
References $file, LocalFile\$repo, File\$title, and Title\makeTitle().
Referenced by newFromKey().
static OldLocalFile::newFromTitle | ( | $ | title, |
$ | repo, | ||
$ | time = null |
||
) | [static] |
MWException |
Reimplemented from LocalFile.
Definition at line 42 of file OldLocalFile.php.
References LocalFile\$repo, and File\$title.
OldLocalFile::recordOldUpload | ( | $ | srcPath, |
$ | archiveName, | ||
$ | timestamp, | ||
$ | comment, | ||
$ | user | ||
) |
Record a file upload in the oldimage table, without adding log entries.
$srcPath | string File system path to the source file |
$archiveName | string The archive name of the file |
$timestamp | string |
$comment | string Upload comment |
$user | User User who did this upload |
Definition at line 323 of file OldLocalFile.php.
References $comment, LocalFile\$timestamp, LocalFile\$user, File\getName(), and getRel().
Referenced by uploadOld().
static OldLocalFile::selectFields | ( | ) | [static] |
Fields in the oldimage table.
Reimplemented from LocalFile.
Definition at line 102 of file OldLocalFile.php.
Fix assorted version-related problems with the image row by reloading it from the file.
Reimplemented from LocalFile.
Definition at line 215 of file OldLocalFile.php.
References File\getName(), LocalFile\loadFromFile(), File\splitMime(), wfDebug(), wfProfileIn(), and wfProfileOut().
OldLocalFile::uploadOld | ( | $ | srcPath, |
$ | archiveName, | ||
$ | timestamp, | ||
$ | comment, | ||
$ | user, | ||
$ | flags = 0 |
||
) |
Upload a file directly into archive.
Generally for Special:Import.
$srcPath | string File system path of the source file |
$archiveName | string Full archive name of the file, in the form $timestamp!$filename, where $filename must match $this->getName() |
$timestamp | string |
$comment | string |
$user | |
$flags | int |
Definition at line 294 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().
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.
$field | Integer |
$user | User object to check, or null to use $wgUser |
Reimplemented from File.
Definition at line 276 of file OldLocalFile.php.
References LocalFile\$user, LocalFile\load(), and Revision\userCanBitfield().
OldLocalFile::$archive_name |
Definition at line 30 of file OldLocalFile.php.
OldLocalFile::$requestedTime |
Definition at line 30 of file OldLocalFile.php.
const OldLocalFile::CACHE_VERSION = 1 |
Definition at line 32 of file OldLocalFile.php.
const OldLocalFile::MAX_CACHE_ROWS = 20 |
Definition at line 33 of file OldLocalFile.php.