|
MediaWiki
REL1_24
|
Class to represent a file in the oldimage table. More...


Public Member Functions | |
| __construct ($title, $repo, $time, $archiveName) | |
| exists () | |
| If archive name is an empty string, then file does not "exist". | |
| getArchiveName () | |
| getCacheFields ($prefix= 'img_') | |
| getCacheKey () | |
| getRel () | |
| getUrlRel () | |
| getVisibility () | |
| Returns bitfield value. | |
| isDeleted ($field) | |
| isOld () | |
| isVisible () | |
| loadFromDB ($flags=0) | |
| 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 | |
| const | CACHE_VERSION = 1 |
| const | MAX_CACHE_ROWS = 20 |
Protected Member Functions | |
| loadExtraFromDB () | |
| Load lazy file metadata from the DB. | |
Protected Attributes | |
| string | $archive_name |
| Archive name *. | |
| string | $requestedTime |
| Timestamp *. | |
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 | |
| FileRepo | $repo | |
| string | $time | Timestamp or null to load by archive name |
| string | $archiveName | Archive name or null to load by timestamp |
| MWException |
Definition at line 134 of file OldLocalFile.php.
If archive name is an empty string, then file does not "exist".
This is the case for a couple files on Wikimedia servers where the old version is "lost".
Reimplemented from LocalFile.
Definition at line 412 of file OldLocalFile.php.
Definition at line 153 of file OldLocalFile.php.
| OldLocalFile::getCacheFields | ( | $ | prefix = 'img_' | ) |
| string | $prefix |
Reimplemented from LocalFile.
Definition at line 238 of file OldLocalFile.php.
Returns bitfield value.
Reimplemented from File.
Definition at line 310 of file OldLocalFile.php.
| OldLocalFile::isDeleted | ( | $ | field | ) |
| int | $field | One of DELETED_* bitfield constants for file or revision rows |
Reimplemented from File.
Definition at line 300 of file OldLocalFile.php.
| OldLocalFile::loadExtraFromDB | ( | ) | [protected] |
Load lazy file metadata from the DB.
Reimplemented from LocalFile.
Definition at line 201 of file OldLocalFile.php.
| OldLocalFile::loadFromDB | ( | $ | flags = 0 | ) |
Load file metadata from the DB.
| int | $flags |
Reimplemented from LocalFile.
Definition at line 175 of file OldLocalFile.php.
| static OldLocalFile::newFromArchiveName | ( | $ | title, |
| $ | repo, | ||
| $ | archiveName | ||
| ) | [static] |
Definition at line 59 of file OldLocalFile.php.
| 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.
| string | $sha1 | Base-36 SHA-1 |
| LocalRepo | $repo | |
| string | bool | $timestamp | MW_timestamp (optional) |
Reimplemented from LocalFile.
Definition at line 86 of file OldLocalFile.php.
| static OldLocalFile::newFromRow | ( | $ | row, |
| $ | repo | ||
| ) | [static] |
| stdClass | $row | |
| FileRepo | $repo |
Reimplemented from LocalFile.
Definition at line 68 of file OldLocalFile.php.
| static OldLocalFile::newFromTitle | ( | $ | title, |
| $ | repo, | ||
| $ | time = null |
||
| ) | [static] |
| MWException |
Reimplemented from LocalFile.
Definition at line 44 of file OldLocalFile.php.
| OldLocalFile::recordOldUpload | ( | $ | srcPath, |
| $ | archiveName, | ||
| $ | timestamp, | ||
| $ | comment, | ||
| $ | user | ||
| ) |
Record a file upload in the oldimage table, without adding log entries.
| string | $srcPath | File system path to the source file |
| string | $archiveName | The archive name of the file |
| string | $timestamp | |
| string | $comment | Upload comment |
| User | $user | User who did this upload |
Definition at line 371 of file OldLocalFile.php.
| static OldLocalFile::selectFields | ( | ) | [static] |
Fields in the oldimage table.
Reimplemented from LocalFile.
Definition at line 106 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 260 of file OldLocalFile.php.
| OldLocalFile::uploadOld | ( | $ | srcPath, |
| $ | archiveName, | ||
| $ | timestamp, | ||
| $ | comment, | ||
| $ | user, | ||
| $ | flags = 0 |
||
| ) |
Upload a file directly into archive.
Generally for Special:Import.
| string | $srcPath | File system path of the source file |
| string | $archiveName | Full archive name of the file, in the form $timestamp!$filename, where $filename must match $this->getName() |
| string | $timestamp | |
| string | $comment | |
| User | $user | |
| int | $flags |
Definition at line 342 of file OldLocalFile.php.
| 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.
Reimplemented from File.
Definition at line 324 of file OldLocalFile.php.
string OldLocalFile::$archive_name [protected] |
Archive name *.
Definition at line 32 of file OldLocalFile.php.
string OldLocalFile::$requestedTime [protected] |
Timestamp *.
Definition at line 30 of file OldLocalFile.php.
| const OldLocalFile::CACHE_VERSION = 1 |
Definition at line 34 of file OldLocalFile.php.
| const OldLocalFile::MAX_CACHE_ROWS = 20 |
Definition at line 35 of file OldLocalFile.php.