MediaWiki REL1_35
|
Class representing a row of the 'filearchive' table. More...
Public Member Functions | |
__construct ( $title, $id=0, $key='', $sha1='') | |
Stable to call. | |
exists () | |
getBits () | |
Return the bits of the image file, in bytes. | |
getDescription () | |
Return upload description. | |
getGroup () | |
Return the FileStore storage group. | |
getHeight () | |
Return the height of the image. | |
getID () | |
getKey () | |
Return the FileStore key. | |
getMediaType () | |
Return the type of the media in the file. | |
getMetadata () | |
Get handler-specific metadata. | |
getMimeType () | |
Returns the MIME type of the file. | |
getName () | |
Return the file name. | |
getRawDescription () | |
Return upload description. | |
getRawUser () | |
Return the user ID of the uploader. | |
getRawUserText () | |
Return the user name of the uploader. | |
getSha1 () | |
Get the SHA-1 base 36 hash of the file. | |
getSize () | |
Return the size of the image file, in bytes. | |
getStorageKey () | |
Return the FileStore key (overriding base File class) | |
getTimestamp () | |
Return upload timestamp. | |
getTitle () | |
Return the associated title object. | |
getUser ( $type='text') | |
Returns ID or name of user who uploaded the file. | |
getVisibility () | |
Returns the deletion bitfield. | |
getWidth () | |
Return the width of the image. | |
isDeleted ( $field) | |
for file or revision rows | |
load () | |
Loads a file object from the filearchive table Stable to override. | |
loadFromRow ( $row) | |
Load ArchivedFile object fields from a DB row. | |
pageCount () | |
Returns the number of pages of a multipage document, or false for documents which aren't multipage documents Stable to override. | |
userCan ( $field, User $user=null) | |
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 | getQueryInfo () |
Return the tables, fields, and join conditions to be selected to create a new archivedfile object. | |
static | newFromRow ( $row) |
Loads a file object from the filearchive table Stable to override. | |
Protected Attributes | |
bool | $exists |
MediaHandler | $handler |
Title | $title |
Private Member Functions | |
getHandler () | |
Get a MediaHandler instance for this file. | |
Private Attributes | |
string | $archive_name |
Original base filename. | |
int | $bits |
Size in bytes. | |
bool | $dataLoaded |
Whether or not all this has been loaded from the database (loadFromXxx) | |
int | $deleted |
Bitfield akin to rev_deleted. | |
string | $description |
Upload description. | |
string | $group |
FileStore storage group. | |
int | $height |
Height. | |
int | $id |
Filearchive row ID. | |
string | $key |
FileStore SHA-1 key. | |
string | $media_type |
Media type. | |
string | $metadata |
Metadata string. | |
string | $mime |
MIME type. | |
string | $name |
File name. | |
int false | $pageCount |
Number of pages of a multipage document, or false for documents which aren't multipage documents. | |
string | $sha1 |
SHA-1 hash of file content. | |
int | $size |
File size in bytes. | |
string | $timestamp |
Time of upload. | |
User null | $user |
Uploader. | |
int | $width |
Width. | |
Class representing a row of the 'filearchive' table.
Stable to extend
Definition at line 33 of file ArchivedFile.php.
ArchivedFile::__construct | ( | $title, | |
$id = 0 , |
|||
$key = '' , |
|||
$sha1 = '' |
|||
) |
Stable to call.
MWException |
Title | $title | |
int | $id | |
string | $key | |
string | $sha1 |
Definition at line 110 of file ArchivedFile.php.
References $id, $key, $sha1, $title, exists(), and Title\getDBkey().
ArchivedFile::exists | ( | ) |
Definition at line 336 of file ArchivedFile.php.
References $exists, and load().
Referenced by __construct(), and load().
ArchivedFile::getBits | ( | ) |
Return the bits of the image file, in bytes.
Definition at line 412 of file ArchivedFile.php.
ArchivedFile::getDescription | ( | ) |
Return upload description.
Definition at line 525 of file ArchivedFile.php.
References $description, isDeleted(), and load().
ArchivedFile::getGroup | ( | ) |
Return the FileStore storage group.
Definition at line 364 of file ArchivedFile.php.
References $group.
|
private |
Get a MediaHandler instance for this file.
Definition at line 432 of file ArchivedFile.php.
References $handler, MediaHandler\getHandler(), and getMimeType().
Referenced by pageCount().
ArchivedFile::getHeight | ( | ) |
ArchivedFile::getID | ( | ) |
ArchivedFile::getKey | ( | ) |
Return the FileStore key.
Definition at line 346 of file ArchivedFile.php.
Referenced by getStorageKey().
ArchivedFile::getMediaType | ( | ) |
Return the type of the media in the file.
Use the value returned by this function with the MEDIATYPE_xxx constants.
Definition at line 466 of file ArchivedFile.php.
References $media_type, and load().
ArchivedFile::getMetadata | ( | ) |
ArchivedFile::getMimeType | ( | ) |
Returns the MIME type of the file.
Definition at line 422 of file ArchivedFile.php.
Referenced by getHandler().
ArchivedFile::getName | ( | ) |
Return the file name.
Definition at line 316 of file ArchivedFile.php.
Referenced by EraseArchivedFile\scrubVersion().
|
static |
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
$table
to IDatabase->select()
$vars
to IDatabase->select()
$join_conds
to IDatabase->select()
Definition at line 234 of file ArchivedFile.php.
Referenced by RevDelArchivedFileList\doQuery(), ApiQueryFilearchive\execute(), LocalFileRestoreBatch\execute(), EraseArchivedFile\execute(), PageArchive\listFiles(), load(), and EraseArchivedFile\scrubAllVersions().
ArchivedFile::getRawDescription | ( | ) |
Return upload description.
Definition at line 557 of file ArchivedFile.php.
References $description, and load().
ArchivedFile::getRawUser | ( | ) |
Return the user ID of the uploader.
Definition at line 539 of file ArchivedFile.php.
References getUser().
ArchivedFile::getRawUserText | ( | ) |
Return the user name of the uploader.
Definition at line 548 of file ArchivedFile.php.
References getUser().
ArchivedFile::getSha1 | ( | ) |
Get the SHA-1 base 36 hash of the file.
Definition at line 489 of file ArchivedFile.php.
ArchivedFile::getSize | ( | ) |
Return the size of the image file, in bytes.
Definition at line 402 of file ArchivedFile.php.
ArchivedFile::getStorageKey | ( | ) |
Return the FileStore key (overriding base File class)
Definition at line 356 of file ArchivedFile.php.
References getKey().
Referenced by EraseArchivedFile\scrubVersion().
ArchivedFile::getTimestamp | ( | ) |
Return upload timestamp.
Definition at line 477 of file ArchivedFile.php.
References load(), and wfTimestamp().
Referenced by EraseArchivedFile\scrubVersion().
ArchivedFile::getTitle | ( | ) |
ArchivedFile::getUser | ( | $type = 'text' | ) |
Returns ID or name of user who uploaded the file.
string | $type | 'text', 'id', or 'object' |
MWException |
Definition at line 506 of file ArchivedFile.php.
References $type, $user, User\getName(), and load().
ArchivedFile::getVisibility | ( | ) |
ArchivedFile::getWidth | ( | ) |
ArchivedFile::isDeleted | ( | $field | ) |
for file or revision rows
int | $field | One of DELETED_* bitfield constants |
Definition at line 579 of file ArchivedFile.php.
References load().
Referenced by getDescription().
ArchivedFile::load | ( | ) |
Loads a file object from the filearchive table Stable to override.
MWException |
Definition at line 159 of file ArchivedFile.php.
References $dbr, $group, $id, $key, $sha1, DB_REPLICA, exists(), getQueryInfo(), loadFromRow(), NS_FILE, and wfGetDB().
Referenced by exists(), getBits(), getDescription(), getHeight(), getID(), getKey(), getMediaType(), getMetadata(), getMimeType(), getName(), getRawDescription(), getSha1(), getSize(), getTimestamp(), getTitle(), getUser(), getVisibility(), getWidth(), isDeleted(), and userCan().
ArchivedFile::loadFromRow | ( | $row | ) |
Load ArchivedFile object fields from a DB row.
Stable to override
stdClass | $row | Object database row |
Definition at line 269 of file ArchivedFile.php.
References DB_REPLICA, LocalRepo\getHashFromKey(), User\newFromAnyId(), NS_FILE, and wfGetDB().
Referenced by load().
|
static |
Loads a file object from the filearchive table Stable to override.
stdClass | $row |
Definition at line 217 of file ArchivedFile.php.
References $file, and NS_FILE.
Referenced by ApiQueryFilearchive\execute(), EraseArchivedFile\execute(), SpecialUndelete\formatFileRow(), RevDelArchivedFileItem\initFile(), and EraseArchivedFile\scrubAllVersions().
ArchivedFile::pageCount | ( | ) |
Returns the number of pages of a multipage document, or false for documents which aren't multipage documents Stable to override.
Definition at line 446 of file ArchivedFile.php.
References $pageCount, getHandler(), and pageCount().
Referenced by pageCount().
ArchivedFile::userCan | ( | $field, | |
User | $user = null |
||
) |
Determine if the current user is allowed to view a particular field of this FileStore image file, if it's marked as deleted.
int | $field | |
null | User | $user | User object to check, or null to use $wgUser (deprecated since 1.35) |
Definition at line 592 of file ArchivedFile.php.
References $title, $user, getTitle(), load(), and wfDeprecated().
|
private |
Original base filename.
Definition at line 91 of file ArchivedFile.php.
|
private |
|
private |
Whether or not all this has been loaded from the database (loadFromXxx)
Definition at line 77 of file ArchivedFile.php.
|
private |
Bitfield akin to rev_deleted.
Definition at line 80 of file ArchivedFile.php.
Referenced by getVisibility().
|
private |
Upload description.
Definition at line 68 of file ArchivedFile.php.
Referenced by getDescription(), and getRawDescription().
|
protected |
Definition at line 100 of file ArchivedFile.php.
Referenced by exists().
|
private |
FileStore storage group.
Definition at line 41 of file ArchivedFile.php.
Referenced by getGroup(), and load().
|
protected |
Definition at line 94 of file ArchivedFile.php.
Referenced by getHandler().
|
private |
|
private |
Filearchive row ID.
Definition at line 35 of file ArchivedFile.php.
Referenced by __construct(), getID(), and load().
|
private |
FileStore SHA-1 key.
Definition at line 44 of file ArchivedFile.php.
Referenced by __construct(), getKey(), and load().
|
private |
|
private |
|
private |
|
private |
|
private |
Number of pages of a multipage document, or false for documents which aren't multipage documents.
Definition at line 88 of file ArchivedFile.php.
Referenced by pageCount().
|
private |
SHA-1 hash of file content.
Definition at line 83 of file ArchivedFile.php.
Referenced by __construct(), getSha1(), and load().
|
private |
|
private |
Time of upload.
Definition at line 74 of file ArchivedFile.php.
|
protected |
Definition at line 97 of file ArchivedFile.php.
Referenced by __construct(), getTitle(), and userCan().
|
private |
|
private |