107 $this->title =
false;
109 $this->
group =
'deleted';
115 $this->metadata =
'';
116 $this->mime =
"unknown/unknown";
117 $this->media_type =
'';
118 $this->description =
'';
120 $this->user_text =
'';
121 $this->timestamp =
null;
123 $this->dataLoaded =
false;
127 if ( $title instanceof
Title ) {
129 $this->name = $title->getDBkey();
145 throw new MWException(
"No specifications provided to ArchivedFile constructor." );
155 if ( $this->dataLoaded ) {
160 if ( $this->
id > 0 ) {
167 if ( $this->title ) {
168 $conds[
'fa_name'] = $this->title->getDBkey();
174 if ( !count( $conds ) ) {
175 throw new MWException(
"No specific information for retrieving archived file" );
178 if ( !$this->title || $this->title->getNamespace() ==
NS_FILE ) {
179 $this->dataLoaded =
true;
181 $row =
$dbr->selectRow(
183 self::selectFields(),
186 [
'ORDER BY' =>
'fa_timestamp DESC' ]
196 throw new MWException(
'This title does not correspond to an image page.' );
211 $file->loadFromRow( $row );
241 'fa_deleted_timestamp',
253 $this->
id = intval( $row->fa_id );
254 $this->name = $row->fa_name;
255 $this->archive_name = $row->fa_archive_name;
256 $this->
group = $row->fa_storage_group;
257 $this->
key = $row->fa_storage_key;
258 $this->size = $row->fa_size;
259 $this->bits = $row->fa_bits;
260 $this->
width = $row->fa_width;
261 $this->height = $row->fa_height;
262 $this->metadata = $row->fa_metadata;
263 $this->mime =
"$row->fa_major_mime/$row->fa_minor_mime";
264 $this->media_type = $row->fa_media_type;
268 $this->user = $row->fa_user;
269 $this->user_text = $row->fa_user_text;
270 $this->timestamp = $row->fa_timestamp;
271 $this->deleted = $row->fa_deleted;
272 if ( isset( $row->fa_sha1 ) ) {
273 $this->sha1 = $row->fa_sha1;
278 if ( !$this->title ) {
279 $this->title = Title::makeTitleSafe(
NS_FILE, $row->fa_name );
289 if ( !$this->title ) {
301 if ( $this->name ===
false ) {
323 return $this->exists;
417 if ( !isset( $this->
handler ) ) {
489 if (
$type ==
'text' ) {
491 } elseif (
$type ==
'id' ) {
564 return ( $this->deleted & $field ) == $field;
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
no text was provided for refs named< code > blankwithnoreference</code ></span ></li ></ol ></div > !end !test with< references/> in group !wikitext Wikipedia rocks< ref > Proceeds of vol XXI</ref > Wikipedia rocks< ref group=note > Proceeds of vol XXI</ref >< references/>< references group=note/> ! html< p > Wikipedia rocks< sup id="cite_ref-1" class="reference">< a href="#cite_note-1"> &Wikipedia rocks< sup id="cite_ref-2" class="reference">< a href="#cite_note-2"> &</p >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-1">< span class="mw-cite-backlink">< a href="#cite_ref-1"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div >< div class="mw-references-wrap">< ol class="references">< li id="cite_note-2">< span class="mw-cite-backlink">< a href="#cite_ref-2"> ↑</a ></span >< span class="reference-text"> Proceeds of vol XXI</span ></li ></ol ></div > !end !test with< references/> in group
Class representing a row of the 'filearchive' table.
getTimestamp()
Return upload timestamp.
getSize()
Return the size of the image file, in bytes.
bool $dataLoaded
Whether or not all this has been loaded from the database (loadFromXxx)
isDeleted( $field)
for file or revision rows
userCan( $field, User $user=null)
Determine if the current user is allowed to view a particular field of this FileStore image file,...
getHeight()
Return the height of the image.
int $user
User ID of uploader.
getBits()
Return the bits of the image file, in bytes.
int $size
File size in bytes.
string $sha1
SHA-1 hash of file content.
string $media_type
Media type.
string $key
FileStore SHA-1 key.
static selectFields()
Fields in the filearchive table.
string $group
FileStore storage group.
string $description
Upload description.
getSha1()
Get the SHA-1 base 36 hash of the file.
string $archive_name
Original base filename.
int false $pageCount
Number of pages of a multipage document, or false for documents which aren't multipage documents.
getHandler()
Get a MediaHandler instance for this file.
loadFromRow( $row)
Load ArchivedFile object fields from a DB row.
getRawUserText()
Return the user name of the uploader.
getDescription()
Return upload description.
int $id
Filearchive row ID.
getRawUser()
Return the user ID of the uploader.
__construct( $title, $id=0, $key='', $sha1='')
load()
Loads a file object from the filearchive table.
pageCount()
Returns the number of pages of a multipage document, or false for documents which aren't multipage do...
getGroup()
Return the FileStore storage group.
static newFromRow( $row)
Loads a file object from the filearchive table.
getTitle()
Return the associated title object.
getWidth()
Return the width of the image.
int $deleted
Bitfield akin to rev_deleted.
getStorageKey()
Return the FileStore key (overriding base File class)
getMimeType()
Returns the MIME type of the file.
getUser( $type='text')
Returns ID or name of user who uploaded the file.
getKey()
Return the FileStore key.
string $metadata
Metadata string.
string $timestamp
Time of upload.
getName()
Return the file name.
getMediaType()
Return the type of the media in the file.
getRawDescription()
Return upload description.
getVisibility()
Returns the deletion bitfield.
getMetadata()
Get handler-specific metadata.
string $user_text
User name of uploader.
static normalizeTitle( $title, $exception=false)
Given a string or Title object return either a valid Title object with namespace NS_FILE or null.
static getHashFromKey( $key)
Gets the SHA1 hash from a storage key.
static userCanBitfield( $bitfield, $field, User $user=null, Title $title=null)
Determine if the current user is allowed to view a particular field of this revision,...
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves set to a MediaTransformOutput the error message to be returned in an array you should do so by altering $wgNamespaceProtection and $wgNamespaceContentModels outside the handler