MediaWiki master
|
Deleted file in the 'filearchive' table. More...
Public Member Functions | |
__construct ( $title, $id=0, $key='', $sha1='') | |
exists () | |
getBits () | |
getDescription (int $audience=self::FOR_PUBLIC, ?Authority $performer=null) | |
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 as a serialized string. | |
getMetadataArray () | |
Get unserialized handler-specific metadata. | |
getMetadataForDb (IReadableDatabase $db) | |
Serialize the metadata array for insertion into img_metadata, oi_metadata or fa_metadata. | |
getMetadataItems (array $itemNames) | |
getMimeType () | |
Returns the MIME type of the file. | |
getName () | |
Return the file name. | |
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. | |
getUploader (int $audience=self::FOR_PUBLIC, ?Authority $performer=null) | |
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. | |
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. | |
userCan ( $field, Authority $performer) | |
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. | |
Public Attributes | |
const | FOR_PUBLIC = 1 |
const | FOR_THIS_USER = 2 |
const | RAW = 3 |
Protected Member Functions | |
loadMetadataFromDbFieldValue (IReadableDatabase $db, $metadataBlob) | |
Unserialize a metadata blob which came from the database and store it in $this. | |
loadMetadataFromString ( $metadataString) | |
Unserialize a metadata string which came from some non-DB source, or is the return value of IReadableDatabase::decodeBlob(). | |
Protected Attributes | |
bool | $exists |
bool | $extraDataLoaded = false |
Whether or not lazy-loaded data has been loaded from the database. | |
MediaHandler | $handler |
array | $metadataArray = [] |
Unserialized metadata. | |
string[] | $metadataBlobs = [] |
Map of metadata item name to blob address. | |
string null | $metadataSerializationFormat |
One of the MDS_* constants, giving the format of the metadata as stored in the DB, or null if the data was not loaded from the DB. | |
Title null | $title |
string[] | $unloadedMetadataBlobs = [] |
Map of metadata item name to blob address for items that exist but have not yet been loaded into $this->metadataArray. | |
Deleted file in the 'filearchive' table.
Definition at line 44 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::__construct | ( | $title, | |
$id = 0, | |||
$key = '', | |||
$sha1 = '' ) |
Title | null | $title | |
int | $id | |
string | $key | |
string | $sha1 |
Definition at line 166 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\$title, MediaWiki\FileRepo\File\ArchivedFile\exists(), MediaWiki\Title\Title\getDBkey(), MediaWiki\MediaWikiServices\getInstance(), and MediaWiki\FileRepo\File\File\normalizeTitle().
MediaWiki\FileRepo\File\ArchivedFile::exists | ( | ) |
Definition at line 380 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\$exists, and MediaWiki\FileRepo\File\ArchivedFile\load().
Referenced by MediaWiki\FileRepo\File\ArchivedFile\__construct(), and MediaWiki\FileRepo\File\ArchivedFile\loadFromRow().
MediaWiki\FileRepo\File\ArchivedFile::getBits | ( | ) |
Definition at line 617 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getDescription | ( | int | $audience = self::FOR_PUBLIC, |
?Authority | $performer = null ) |
Return upload description.
int | $audience | One of: File::FOR_PUBLIC to be displayed to all users File::FOR_THIS_USER to be displayed to the given user File::RAW get the description regardless of permissions |
Authority | null | $performer | to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 734 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getGroup | ( | ) |
MediaWiki\FileRepo\File\ArchivedFile::getHeight | ( | ) |
Return the height of the image.
Definition at line 426 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\load().
MediaWiki\FileRepo\File\ArchivedFile::getID | ( | ) |
Definition at line 371 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\load().
MediaWiki\FileRepo\File\ArchivedFile::getKey | ( | ) |
Return the FileStore key.
Definition at line 390 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\load().
Referenced by MediaWiki\FileRepo\File\ArchivedFile\getStorageKey().
MediaWiki\FileRepo\File\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 671 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getMetadata | ( | ) |
Get handler-specific metadata as a serialized string.
Definition at line 438 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\getMetadataArray().
MediaWiki\FileRepo\File\ArchivedFile::getMetadataArray | ( | ) |
Get unserialized handler-specific metadata.
Definition at line 456 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\getMetadataItems().
Referenced by MediaWiki\FileRepo\File\ArchivedFile\getMetadata().
MediaWiki\FileRepo\File\ArchivedFile::getMetadataForDb | ( | IReadableDatabase | $db | ) |
Serialize the metadata array for insertion into img_metadata, oi_metadata or fa_metadata.
If metadata splitting is enabled, this may write blobs to the database, returning their addresses.
IReadableDatabase | $db |
Definition at line 506 of file ArchivedFile.php.
References Wikimedia\Rdbms\IReadableDatabase\encodeBlob().
MediaWiki\FileRepo\File\ArchivedFile::getMetadataItems | ( | array | $itemNames | ) |
Definition at line 469 of file ArchivedFile.php.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\getMetadataArray().
MediaWiki\FileRepo\File\ArchivedFile::getMimeType | ( | ) |
MediaWiki\FileRepo\File\ArchivedFile::getName | ( | ) |
Return the file name.
Definition at line 360 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\load().
Referenced by EraseArchivedFile\scrubVersion().
|
static |
Return the tables, fields, and join conditions to be selected to create a new archivedfile object.
Since 1.34, fa_user and fa_user_text have not been present in the database, but they continue to be available in query results as an alias.
$table
to IDatabase->select()
or SelectQueryBuilder::tables
$vars
to IDatabase->select()
or SelectQueryBuilder::fields
$join_conds
to IDatabase->select()
or SelectQueryBuilder::joinConds
Definition at line 292 of file ArchivedFile.php.
References MediaWiki\MediaWikiServices\getInstance(), MediaWiki\FileRepo\File\ArchivedFile\getQueryInfo(), and MediaWiki\FileRepo\File\FileSelectQueryBuilder\newForArchivedFile().
Referenced by MediaWiki\Api\ApiQueryFilearchive\execute(), and MediaWiki\FileRepo\File\ArchivedFile\getQueryInfo().
MediaWiki\FileRepo\File\ArchivedFile::getSha1 | ( | ) |
Get the SHA-1 base 36 hash of the file.
Definition at line 694 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getSize | ( | ) |
Return the size of the image file, in bytes.
Definition at line 608 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getStorageKey | ( | ) |
Return the FileStore key (overriding base File class)
Definition at line 400 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\getKey().
Referenced by EraseArchivedFile\scrubVersion().
MediaWiki\FileRepo\File\ArchivedFile::getTimestamp | ( | ) |
Return upload timestamp.
Definition at line 682 of file ArchivedFile.php.
References wfTimestamp().
Referenced by EraseArchivedFile\scrubVersion().
MediaWiki\FileRepo\File\ArchivedFile::getTitle | ( | ) |
Return the associated title object.
Definition at line 348 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\$title, and MediaWiki\FileRepo\File\ArchivedFile\load().
MediaWiki\FileRepo\File\ArchivedFile::getUploader | ( | int | $audience = self::FOR_PUBLIC, |
?Authority | $performer = null ) |
int | $audience | One of: File::FOR_PUBLIC to be displayed to all users File::FOR_THIS_USER to be displayed to the given user File::RAW get the description regardless of permissions |
Authority | null | $performer | to check for, only if FOR_THIS_USER is passed to the $audience parameter |
Definition at line 711 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::getVisibility | ( | ) |
MediaWiki\FileRepo\File\ArchivedFile::getWidth | ( | ) |
Return the width of the image.
Definition at line 416 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\load().
MediaWiki\FileRepo\File\ArchivedFile::isDeleted | ( | $field | ) |
for file or revision rows
int | $field | One of DELETED_* bitfield constants |
Definition at line 761 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::load | ( | ) |
Loads a file object from the filearchive table.
Definition at line 216 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\loadFromRow(), MediaWiki\FileRepo\File\FileSelectQueryBuilder\newForArchivedFile(), and NS_FILE.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\exists(), MediaWiki\FileRepo\File\ArchivedFile\getHeight(), MediaWiki\FileRepo\File\ArchivedFile\getID(), MediaWiki\FileRepo\File\ArchivedFile\getKey(), MediaWiki\FileRepo\File\ArchivedFile\getName(), MediaWiki\FileRepo\File\ArchivedFile\getTitle(), and MediaWiki\FileRepo\File\ArchivedFile\getWidth().
MediaWiki\FileRepo\File\ArchivedFile::loadFromRow | ( | $row | ) |
Load ArchivedFile object fields from a DB row.
stdClass | $row | Object database row |
Definition at line 309 of file ArchivedFile.php.
References MediaWiki\FileRepo\File\ArchivedFile\exists(), MediaWiki\FileRepo\LocalRepo\getHashFromKey(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\FileRepo\File\ArchivedFile\loadMetadataFromDbFieldValue(), and NS_FILE.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\load().
|
protected |
Unserialize a metadata blob which came from the database and store it in $this.
IReadableDatabase | $db | |
string | Blob | $metadataBlob |
Definition at line 554 of file ArchivedFile.php.
References Wikimedia\Rdbms\IReadableDatabase\decodeBlob().
Referenced by MediaWiki\FileRepo\File\ArchivedFile\loadFromRow().
|
protected |
Unserialize a metadata string which came from some non-DB source, or is the return value of IReadableDatabase::decodeBlob().
string | $metadataString |
Definition at line 565 of file ArchivedFile.php.
|
static |
Loads a file object from the filearchive table.
stdClass | $row |
Definition at line 268 of file ArchivedFile.php.
References NS_FILE.
Referenced by MediaWiki\Api\ApiQueryFilearchive\execute().
MediaWiki\FileRepo\File\ArchivedFile::pageCount | ( | ) |
Returns the number of pages of a multipage document, or false for documents which aren't multipage documents.
Definition at line 651 of file ArchivedFile.php.
MediaWiki\FileRepo\File\ArchivedFile::userCan | ( | $field, | |
Authority | $performer ) |
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 | |
Authority | $performer |
Definition at line 774 of file ArchivedFile.php.
References getTitle().
|
protected |
Definition at line 151 of file ArchivedFile.php.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\exists().
|
protected |
Whether or not lazy-loaded data has been loaded from the database.
Definition at line 91 of file ArchivedFile.php.
|
protected |
Definition at line 145 of file ArchivedFile.php.
|
protected |
Unserialized metadata.
Definition at line 88 of file ArchivedFile.php.
|
protected |
Map of metadata item name to blob address.
Definition at line 102 of file ArchivedFile.php.
|
protected |
One of the MDS_* constants, giving the format of the metadata as stored in the DB, or null if the data was not loaded from the DB.
Definition at line 99 of file ArchivedFile.php.
|
protected |
Definition at line 148 of file ArchivedFile.php.
Referenced by MediaWiki\FileRepo\File\ArchivedFile\__construct(), and MediaWiki\FileRepo\File\ArchivedFile\getTitle().
|
protected |
Map of metadata item name to blob address for items that exist but have not yet been loaded into $this->metadataArray.
Definition at line 110 of file ArchivedFile.php.
const MediaWiki\FileRepo\File\ArchivedFile::FOR_PUBLIC = 1 |
Definition at line 47 of file ArchivedFile.php.
const MediaWiki\FileRepo\File\ArchivedFile::FOR_THIS_USER = 2 |
Definition at line 48 of file ArchivedFile.php.
const MediaWiki\FileRepo\File\ArchivedFile::RAW = 3 |
Definition at line 49 of file ArchivedFile.php.