MediaWiki
REL1_19
|
Foreign file accessible through api.php requests. More...
Public Member Functions | |
__construct ($title, $repo, $info, $exists=false) | |
exists () | |
Returns true if file exists in the repository. | |
getDescription () | |
Get discription of file revision STUB. | |
getDescriptionUrl () | |
Get the URL of the image description page. | |
getHeight ($page=1) | |
getMediaType () | |
getMetadata () | |
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB. | |
getMimeType () | |
Returns the mime type of the file. | |
getPath () | |
Return the storage path to the file. | |
getSha1 () | |
Get the SHA-1 base 36 hash of the file. | |
getSize () | |
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB. | |
getThumbnails () | |
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile. | |
getThumbPath ($suffix= '') | |
Only useful if we're locally caching thumbs anyway... | |
getTimestamp () | |
Get the 14-character timestamp of the file upload. | |
getUrl () | |
Return the URL of the file. | |
getUser ($method='text') | |
Returns ID or name of user who uploaded the file STUB. | |
getWidth ($page=1) | |
Return the width of the image. | |
purgeCache ($options=array()) | |
purgeDescriptionPage () | |
purgeThumbnails ($options=array()) | |
transform ($params, $flags=0) | |
Transform a media file. | |
Static Public Member Functions | |
static | getProps () |
Get the property string for iiprop and aiprop. | |
static | newFromTitle (Title $title, $repo) |
static | parseMetadata ($metadata) |
Protected Attributes | |
$repoClass = 'ForeignApiRepo' | |
Private Attributes | |
$mExists |
Foreign file accessible through api.php requests.
Very hacky and inefficient, do not use :D
Definition at line 15 of file ForeignAPIFile.php.
ForeignAPIFile::__construct | ( | $ | title, |
$ | repo, | ||
$ | info, | ||
$ | exists = false |
||
) |
$title | ||
$repo | ForeignApiRepo | |
$info | ||
bool | $exists |
Definition at line 26 of file ForeignAPIFile.php.
References File\$repo, File\$title, and File\assertRepoDefined().
Returns true if file exists in the repository.
Overridden by LocalFile to avoid unnecessary stat calls.
Reimplemented from File.
Definition at line 77 of file ForeignAPIFile.php.
Get discription of file revision STUB.
Reimplemented from File.
Definition at line 146 of file ForeignAPIFile.php.
Get the URL of the image description page.
May return false if it is unknown or not applicable.
Reimplemented from File.
Definition at line 178 of file ForeignAPIFile.php.
ForeignAPIFile::getHeight | ( | $ | page = 1 | ) |
$page | int |
Reimplemented from File.
Definition at line 112 of file ForeignAPIFile.php.
Reimplemented from File.
Definition at line 173 of file ForeignAPIFile.php.
References getMimeType(), and MimeMagic\singleton().
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented from File.
Definition at line 116 of file ForeignAPIFile.php.
Returns the mime type of the file.
Overridden by LocalFile, UnregisteredLocalFile STUB
Reimplemented from File.
Definition at line 164 of file ForeignAPIFile.php.
References File\getExtension(), and MimeMagic\singleton().
Referenced by getMediaType().
Return the storage path to the file.
Note that this does not mean that a file actually exists under that location.
This path depends on whether directory hashing is active or not, i.e. whether the files are all found in the same directory, or in hashed paths like /images/3/3c.
Most callers don't check the return value, but ForeignAPIFile::getPath returns false.
Reimplemented from File.
Definition at line 81 of file ForeignAPIFile.php.
static ForeignAPIFile::getProps | ( | ) | [static] |
Get the property string for iiprop and aiprop.
Definition at line 72 of file ForeignAPIFile.php.
Referenced by ForeignAPIRepo\findBySha1(), and newFromTitle().
Get the SHA-1 base 36 hash of the file.
Reimplemented from File.
Definition at line 150 of file ForeignAPIFile.php.
References wfBaseConvert().
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented from File.
Definition at line 134 of file ForeignAPIFile.php.
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile.
Reimplemented from File.
Definition at line 199 of file ForeignAPIFile.php.
References $dir, $file, $files, File\getName(), and getThumbPath().
Referenced by purgeThumbnails().
ForeignAPIFile::getThumbPath | ( | $ | suffix = '' | ) |
Only useful if we're locally caching thumbs anyway...
Reimplemented from File.
Definition at line 187 of file ForeignAPIFile.php.
References File\$path, File\getHashPath(), and File\getName().
Referenced by getThumbnails(), and purgeThumbnails().
Get the 14-character timestamp of the file upload.
Reimplemented from File.
Definition at line 156 of file ForeignAPIFile.php.
References wfTimestamp().
Return the URL of the file.
Reimplemented from File.
Definition at line 138 of file ForeignAPIFile.php.
ForeignAPIFile::getUser | ( | $ | type = 'text' | ) |
Returns ID or name of user who uploaded the file STUB.
$type | string 'text' or 'id' |
Reimplemented from File.
Definition at line 142 of file ForeignAPIFile.php.
ForeignAPIFile::getWidth | ( | $ | page = 1 | ) |
Return the width of the image.
Returns false if the width is unknown or undefined.
STUB Overridden by LocalFile, UnregisteredLocalFile
$page | int |
Reimplemented from File.
Definition at line 104 of file ForeignAPIFile.php.
static ForeignAPIFile::newFromTitle | ( | Title $ | title, |
$ | repo | ||
) | [static] |
$title | Title |
$repo | ForeignApiRepo |
Definition at line 40 of file ForeignAPIFile.php.
References File\$repo, File\$title, Title\getDBkey(), MediaHandler\getMetadataVersion(), getProps(), and Title\newFromText().
static ForeignAPIFile::parseMetadata | ( | $ | metadata | ) | [static] |
Definition at line 123 of file ForeignAPIFile.php.
ForeignAPIFile::purgeCache | ( | $ | options = array() | ) |
Reimplemented from File.
Definition at line 214 of file ForeignAPIFile.php.
References $options, purgeDescriptionPage(), and purgeThumbnails().
Definition at line 219 of file ForeignAPIFile.php.
References File\$url, $wgContLang, $wgMemc, and File\getName().
Referenced by purgeCache().
ForeignAPIFile::purgeThumbnails | ( | $ | options = array() | ) |
Definition at line 228 of file ForeignAPIFile.php.
References $dir, $file, $files, File\$handler, $options, $wgMemc, File\getHandler(), File\getName(), getThumbnails(), getThumbPath(), and FileRepo\SKIP_LOCKING.
Referenced by purgeCache().
ForeignAPIFile::transform | ( | $ | params, |
$ | flags = 0 |
||
) |
Transform a media file.
$params | Array: an associative array of handler-specific parameters. Typical keys are width, height and page. |
$flags | Integer: a bitfield, may contain self::RENDER_NOW to force rendering |
Reimplemented from File.
Definition at line 85 of file ForeignAPIFile.php.
References File\canRender(), and File\getName().
ForeignAPIFile::$mExists [private] |
Definition at line 16 of file ForeignAPIFile.php.
ForeignAPIFile::$repoClass = 'ForeignApiRepo' [protected] |
Reimplemented from File.
Definition at line 18 of file ForeignAPIFile.php.