|
MediaWiki REL1_39
|
Deleted file in the 'filearchive' table. More...

Public Member Functions | |
| __construct ( $title, $id=0, $key='', $sha1='') | |
| exists () | |
| getBits () | |
| Return the bits of the image file, in bytes. | |
| 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 (IDatabase $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 (IDatabase $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 IDatabase::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 34 of file ArchivedFile.php.
| ArchivedFile::__construct | ( | $title, | |
| $id = 0, | |||
| $key = '', | |||
| $sha1 = '' ) |
| MWException |
| Title | null | $title | |
| int | $id | |
| string | $key | |
| string | $sha1 |
Definition at line 157 of file ArchivedFile.php.
References $title, exists(), and Title\getDBkey().
| ArchivedFile::exists | ( | ) |
Definition at line 401 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 639 of file ArchivedFile.php.
| 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 756 of file ArchivedFile.php.
| ArchivedFile::getGroup | ( | ) |
| ArchivedFile::getHeight | ( | ) |
Return the height of the image.
Definition at line 447 of file ArchivedFile.php.
References load().
| ArchivedFile::getID | ( | ) |
| ArchivedFile::getKey | ( | ) |
Return the FileStore key.
Definition at line 411 of file ArchivedFile.php.
References load().
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 693 of file ArchivedFile.php.
| ArchivedFile::getMetadata | ( | ) |
Get handler-specific metadata as a serialized string.
Definition at line 459 of file ArchivedFile.php.
References getMetadataArray(), and serialize().
| ArchivedFile::getMetadataArray | ( | ) |
Get unserialized handler-specific metadata.
Definition at line 477 of file ArchivedFile.php.
References getMetadataItems().
Referenced by getMetadata().
| ArchivedFile::getMetadataForDb | ( | IDatabase | $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.
| IDatabase | $db |
Definition at line 527 of file ArchivedFile.php.
References $s, Wikimedia\Rdbms\IDatabase\encodeBlob(), and serialize().
| ArchivedFile::getMetadataItems | ( | array | $itemNames | ) |
Definition at line 490 of file ArchivedFile.php.
Referenced by getMetadataArray().
| ArchivedFile::getMimeType | ( | ) |
Returns the MIME type of the file.
Definition at line 649 of file ArchivedFile.php.
References $mime.
| ArchivedFile::getName | ( | ) |
Return the file name.
Definition at line 381 of file ArchivedFile.php.
References 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 289 of file ArchivedFile.php.
Referenced by RevDelArchivedFileList\doQuery(), ApiQueryFilearchive\execute(), LocalFileRestoreBatch\execute(), EraseArchivedFile\execute(), PageArchive\listFiles(), load(), and EraseArchivedFile\scrubAllVersions().
| ArchivedFile::getSha1 | ( | ) |
Get the SHA-1 base 36 hash of the file.
Definition at line 716 of file ArchivedFile.php.
| ArchivedFile::getSize | ( | ) |
Return the size of the image file, in bytes.
Definition at line 629 of file ArchivedFile.php.
| ArchivedFile::getStorageKey | ( | ) |
Return the FileStore key (overriding base File class)
Definition at line 421 of file ArchivedFile.php.
References getKey().
Referenced by EraseArchivedFile\scrubVersion().
| ArchivedFile::getTimestamp | ( | ) |
Return upload timestamp.
Definition at line 704 of file ArchivedFile.php.
References wfTimestamp().
Referenced by EraseArchivedFile\scrubVersion().
| ArchivedFile::getTitle | ( | ) |
| 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 733 of file ArchivedFile.php.
| ArchivedFile::getVisibility | ( | ) |
| ArchivedFile::getWidth | ( | ) |
Return the width of the image.
Definition at line 437 of file ArchivedFile.php.
References load().
| ArchivedFile::isDeleted | ( | $field | ) |
for file or revision rows
| int | $field | One of DELETED_* bitfield constants |
Definition at line 783 of file ArchivedFile.php.
| ArchivedFile::load | ( | ) |
Loads a file object from the filearchive table.
| MWException |
Definition at line 208 of file ArchivedFile.php.
References $dbr, DB_REPLICA, exists(), getQueryInfo(), loadFromRow(), NS_FILE, and wfGetDB().
Referenced by exists(), getHeight(), getID(), getKey(), getName(), getTitle(), and getWidth().
| ArchivedFile::loadFromRow | ( | $row | ) |
Load ArchivedFile object fields from a DB row.
| stdClass | $row | Object database row |
Definition at line 331 of file ArchivedFile.php.
References DB_REPLICA, loadMetadataFromDbFieldValue(), NS_FILE, and wfGetDB().
Referenced by load().
|
protected |
Unserialize a metadata blob which came from the database and store it in $this.
| IDatabase | $db | |
| string | Blob | $metadataBlob |
Definition at line 575 of file ArchivedFile.php.
References Wikimedia\Rdbms\IDatabase\decodeBlob().
Referenced by loadFromRow().
|
protected |
Unserialize a metadata string which came from some non-DB source, or is the return value of IDatabase::decodeBlob().
| string | $metadataString |
Definition at line 586 of file ArchivedFile.php.
References unserialize().
|
static |
Loads a file object from the filearchive table.
| stdClass | $row |
Definition at line 266 of file ArchivedFile.php.
References $file, and NS_FILE.
Referenced by ApiQueryFilearchive\execute(), EraseArchivedFile\execute(), 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.
Definition at line 673 of file ArchivedFile.php.
| 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 796 of file ArchivedFile.php.
References $title, and getTitle().
|
protected |
Definition at line 141 of file ArchivedFile.php.
Referenced by exists().
|
protected |
Whether or not lazy-loaded data has been loaded from the database.
Definition at line 81 of file ArchivedFile.php.
|
protected |
Definition at line 135 of file ArchivedFile.php.
|
protected |
Unserialized metadata.
Definition at line 78 of file ArchivedFile.php.
|
protected |
Map of metadata item name to blob address.
Definition at line 92 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 89 of file ArchivedFile.php.
|
protected |
Definition at line 138 of file ArchivedFile.php.
Referenced by __construct(), and 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 100 of file ArchivedFile.php.
| const ArchivedFile::FOR_PUBLIC = 1 |
Definition at line 37 of file ArchivedFile.php.
| const ArchivedFile::FOR_THIS_USER = 2 |
Definition at line 38 of file ArchivedFile.php.
Referenced by RevDelArchivedFileItem\getApiData().
| const ArchivedFile::RAW = 3 |
Definition at line 39 of file ArchivedFile.php.