Inherits File.
Public Member Functions | |
__construct ($title, $repo, $info, $exists=false) | |
exists () | |
Returns true if file exists in the repository. | |
getPath () | |
Return the full filesystem path to the file. | |
transform ($params, $flags=0) | |
Transform a media file. | |
getWidth ($page=1) | |
Return the width of the image. | |
getHeight ($page=1) | |
Return the height of the image. | |
getMetadata () | |
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB. | |
getSize () | |
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB. | |
getUrl () | |
Return the URL of the file. | |
getUser ($method='text') | |
Returns ID or name of user who uploaded the file STUB. | |
getDescription () | |
Get discription of file revision STUB. | |
getSha1 () | |
Get the SHA-1 base 36 hash of the file. | |
getTimestamp () | |
Get the 14-character timestamp of the file upload, or false if it doesn't exist. | |
getMimeType () | |
Returns the mime type of the file. | |
getMediaType () | |
May guess wrong on file types that can be eg audio or video | |
getDescriptionUrl () | |
Get the URL of the image description page. | |
getThumbPath ($suffix= '') | |
Only useful if we're locally caching thumbs anyway. | |
getThumbnails () | |
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile. | |
purgeCache () | |
Purge shared caches such as thumbnails and DB data caching STUB Overridden by LocalFile. | |
purgeDescriptionPage () | |
purgeThumbnails () | |
Static Public Member Functions | |
static | newFromTitle ($title, $repo) |
static | parseMetadata ($metadata) |
Private Attributes | |
$mExists |
Definition at line 9 of file ForeignAPIFile.php.
ForeignAPIFile::__construct | ( | $ | title, | |
$ | repo, | |||
$ | info, | |||
$ | exists = false | |||
) |
ForeignAPIFile::exists | ( | ) |
Returns true if file exists in the repository.
Overridden by LocalFile to avoid unnecessary stat calls.
Reimplemented from File.
Definition at line 29 of file ForeignAPIFile.php.
ForeignAPIFile::getDescription | ( | ) |
Get discription of file revision STUB.
Reimplemented from File.
Definition at line 91 of file ForeignAPIFile.php.
ForeignAPIFile::getDescriptionUrl | ( | ) |
Get the URL of the image description page.
May return false if it is unknown or not applicable.
Reimplemented from File.
Definition at line 117 of file ForeignAPIFile.php.
ForeignAPIFile::getHeight | ( | $ | page = 1 |
) |
Return the height of the image.
Returns false if the height is unknown or undefined
STUB Overridden by LocalFile, UnregisteredLocalFile
Reimplemented from File.
Definition at line 57 of file ForeignAPIFile.php.
ForeignAPIFile::getMediaType | ( | ) |
May guess wrong on file types that can be eg audio or video
Reimplemented from File.
Definition at line 112 of file ForeignAPIFile.php.
References getMimeType(), and MimeMagic::singleton().
ForeignAPIFile::getMetadata | ( | ) |
Get handler-specific metadata Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented from File.
Definition at line 61 of file ForeignAPIFile.php.
ForeignAPIFile::getMimeType | ( | ) |
Returns the mime type of the file.
Overridden by LocalFile, UnregisteredLocalFile STUB
Reimplemented from File.
Definition at line 103 of file ForeignAPIFile.php.
References File::getExtension(), and MimeMagic::singleton().
Referenced by getMediaType().
ForeignAPIFile::getPath | ( | ) |
Return the full filesystem 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.
May return false if the file is not locally accessible.
Reimplemented from File.
Definition at line 33 of file ForeignAPIFile.php.
ForeignAPIFile::getSha1 | ( | ) |
Get the SHA-1 base 36 hash of the file.
Reimplemented from File.
Definition at line 95 of file ForeignAPIFile.php.
References wfBaseConvert().
ForeignAPIFile::getSize | ( | ) |
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB.
Reimplemented from File.
Definition at line 79 of file ForeignAPIFile.php.
ForeignAPIFile::getThumbnails | ( | ) |
Get all thumbnail names previously generated for this file STUB Overridden by LocalFile.
Reimplemented from File.
Definition at line 140 of file ForeignAPIFile.php.
References $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 126 of file ForeignAPIFile.php.
References $path, $suffix, $wgUploadDirectory, File::getHashPath(), and File::getName().
Referenced by getThumbnails(), and purgeThumbnails().
ForeignAPIFile::getTimestamp | ( | ) |
Get the 14-character timestamp of the file upload, or false if it doesn't exist.
Reimplemented from File.
Definition at line 99 of file ForeignAPIFile.php.
References wfTimestamp().
ForeignAPIFile::getUrl | ( | ) |
Return the URL of the file.
Reimplemented from File.
Definition at line 83 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 87 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
Reimplemented from File.
Definition at line 53 of file ForeignAPIFile.php.
static ForeignAPIFile::newFromTitle | ( | $ | title, | |
$ | repo | |||
) | [static] |
static ForeignAPIFile::parseMetadata | ( | $ | metadata | ) | [static] |
Definition at line 68 of file ForeignAPIFile.php.
ForeignAPIFile::purgeCache | ( | ) |
Purge shared caches such as thumbnails and DB data caching STUB Overridden by LocalFile.
Reimplemented from File.
Definition at line 157 of file ForeignAPIFile.php.
References purgeDescriptionPage(), and purgeThumbnails().
ForeignAPIFile::purgeDescriptionPage | ( | ) |
Definition at line 162 of file ForeignAPIFile.php.
References $key, $url, $wgContLang, $wgMemc, File::getName(), and wfMemcKey().
Referenced by purgeCache().
ForeignAPIFile::purgeThumbnails | ( | ) |
Definition at line 169 of file ForeignAPIFile.php.
References $file, $files, $key, $wgMemc, File::getName(), getThumbnails(), getThumbPath(), and wfMemcKey().
Referenced by purgeCache().
ForeignAPIFile::transform | ( | $ | params, | |
$ | flags = 0 | |||
) |
Transform a media file.
array | $params An associative array of handler-specific parameters. Typical keys are width, height and page. | |
integer | $flags A bitfield, may contain self::RENDER_NOW to force rendering |
Reimplemented from File.
Definition at line 37 of file ForeignAPIFile.php.
References $flags, File::canRender(), and File::getName().
ForeignAPIFile::$mExists [private] |
Definition at line 11 of file ForeignAPIFile.php.