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;
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" );
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 );
240 'fa_deleted_timestamp',
252 $this->
id = intval( $row->fa_id );
253 $this->
name = $row->fa_name;
254 $this->archive_name = $row->fa_archive_name;
255 $this->group = $row->fa_storage_group;
256 $this->
key = $row->fa_storage_key;
257 $this->size = $row->fa_size;
258 $this->bits = $row->fa_bits;
259 $this->
width = $row->fa_width;
260 $this->height = $row->fa_height;
261 $this->metadata = $row->fa_metadata;
262 $this->mime =
"$row->fa_major_mime/$row->fa_minor_mime";
263 $this->media_type = $row->fa_media_type;
264 $this->description = $row->fa_description;
265 $this->
user = $row->fa_user;
266 $this->user_text = $row->fa_user_text;
267 $this->timestamp = $row->fa_timestamp;
268 $this->deleted = $row->fa_deleted;
269 if ( isset( $row->fa_sha1 ) ) {
270 $this->sha1 = $row->fa_sha1;
275 if ( !$this->
title ) {
286 if ( !$this->
title ) {
298 if ( $this->
name ===
false ) {
320 return $this->exists;
414 if ( !isset( $this->
handler ) ) {
485 if (
$type ==
'text' ) {
487 } elseif (
$type ==
'id' ) {
576 return ( $this->deleted & $field ) == $field;
int $user
User ID of uploader.
getDescription()
Return upload description.
string $media_type
Media type.
static normalizeTitle($title, $exception=false)
Given a string or Title object return either a valid Title object with namespace NS_FILE or null...
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
getRawUser()
Return the user ID of the uploader.
int $deleted
Bitfield akin to rev_deleted.
loadFromRow($row)
Load ArchivedFile object fields from a DB row.
getRawUserText()
Return the user name of the uploader.
getStorageKey()
Return the FileStore key (overriding base File class)
bool $dataLoaded
Whether or not all this has been loaded from the database (loadFromXxx)
string $group
FileStore storage group.
getSha1()
Get the SHA-1 base 36 hash of the file.
getUserText()
Return the user name of the uploader.
getHeight()
Return the height of the image.
Represents a title within MediaWiki.
getMetadata()
Get handler-specific metadata.
getHandler()
Get a MediaHandler instance for this file.
string $timestamp
Time of upload.
getName()
Return the file name.
getGroup()
Return the FileStore storage group.
string $description
Upload description.
getWidth()
Return the width of the image.
pageCount()
Returns the number of pages of a multipage document, or false for documents which aren't multipage do...
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Class representing a row of the 'filearchive' table.
getTitle()
Return the associated title object.
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
getSize()
Return the size of the image file, in bytes.
getDBkey()
Get the main part with underscores.
static selectFields()
Fields in the filearchive table.
__construct($title, $id=0, $key= '', $sha1= '')
string $user_text
User name of uploader.
getMediaType()
Return the type of the media in the file.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
Wikitext formatted, in the key only.
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
string $sha1
SHA-1 hash of file content.
getKey()
Return the FileStore key.
static newFromRow($row)
Loads a file object from the filearchive table.
int $size
File size in bytes.
string $metadata
Metadata string.
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
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
string $key
FileStore SHA-1 key.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static getHashFromKey($key)
Gets the SHA1 hash from a storage key.
string $archive_name
Original base filename.
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 name
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
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, if it's marked as deleted.
isDeleted($field)
for file or revision rows
int $id
Filearchive row ID.
string $pageCount
Number of pages of a multipage document, or false for documents which aren't multipage documents...
load()
Loads a file object from the filearchive table.
getRawDescription()
Return upload description.
getUser($type= 'text')
Returns ID or name of user who uploaded the file.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
static makeTitle($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
getTimestamp()
Return upload timestamp.
userCan($field, User $user=null)
Determine if the current user is allowed to view a particular field of this FileStore image file...
getMimeType()
Returns the MIME type of the file.
getBits()
Return the bits of the image file, in bytes.
getVisibility()
Returns the deletion bitfield.