MediaWiki  REL1_22
ForeignAPIFile Class Reference

Foreign file accessible through api.php requests. More...

Inheritance diagram for ForeignAPIFile:
Collaboration diagram for ForeignAPIFile:

List of all members.

Public Member Functions

 __construct ($title, $repo, $info, $exists=false)
 exists ()
 getDescription ($audience=self::FOR_PUBLIC, User $user=null)
 getDescriptionUrl ()
 getHeight ($page=1)
 getMediaType ()
 getMetadata ()
 getMimeType ()
 getPath ()
 getSha1 ()
 getSize ()
 getThumbnails ()
 getThumbPath ($suffix= '')
 Only useful if we're locally caching thumbs anyway...
 getTimestamp ()
 getUrl ()
 getUser ($method= 'text')
 getWidth ($page=1)
 purgeCache ($options=array())
 purgeDescriptionPage ()
 purgeThumbnails ($options=array())
 transform ($params, $flags=0)

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'
 Required Repository class type.

Private Attributes

 $mExists

Detailed Description

Foreign file accessible through api.php requests.

Very hacky and inefficient, do not use :D

Definition at line 30 of file ForeignAPIFile.php.


Constructor & Destructor Documentation

ForeignAPIFile::__construct ( title,
repo,
info,
exists = false 
)
Parameters:
$title
$repoForeignApiRepo
$info
bool$exists

Definition at line 41 of file ForeignAPIFile.php.

References File\$repo, File\$title, and File\assertRepoDefined().


Member Function Documentation

Returns:
bool

Reimplemented from File.

Definition at line 97 of file ForeignAPIFile.php.

ForeignAPIFile::getDescription ( audience = self::FOR_PUBLIC,
User user = null 
)
Returns:
null|string

Reimplemented from File.

Definition at line 212 of file ForeignAPIFile.php.

Returns:
bool|string

Reimplemented from File.

Definition at line 261 of file ForeignAPIFile.php.

ForeignAPIFile::getHeight ( page = 1)
Parameters:
$pageint
Returns:
int

Reimplemented from File.

Definition at line 158 of file ForeignAPIFile.php.

Returns:
int|string

Reimplemented from File.

Definition at line 250 of file ForeignAPIFile.php.

References getMimeType(), and MimeMagic\singleton().

Returns:
bool|null|string

Reimplemented from File.

Definition at line 165 of file ForeignAPIFile.php.

Returns:
string

Reimplemented from File.

Definition at line 239 of file ForeignAPIFile.php.

References File\getExtension(), and MimeMagic\singleton().

Referenced by getMediaType().

Returns:
bool

Reimplemented from File.

Definition at line 104 of file ForeignAPIFile.php.

static ForeignAPIFile::getProps ( ) [static]

Get the property string for iiprop and aiprop.

Returns:
string

Definition at line 88 of file ForeignAPIFile.php.

Referenced by ForeignAPIRepo\findBySha1(), and newFromTitle().

Returns:
null|String

Reimplemented from File.

Definition at line 219 of file ForeignAPIFile.php.

References wfBaseConvert().

Returns:
bool|int|null

Reimplemented from File.

Definition at line 190 of file ForeignAPIFile.php.

Returns:
array

Reimplemented from File.

Definition at line 287 of file ForeignAPIFile.php.

References $dir, $file, $files, array(), as, File\getName(), and getThumbPath().

Referenced by purgeThumbnails().

ForeignAPIFile::getThumbPath ( suffix = '')

Only useful if we're locally caching thumbs anyway...

Parameters:
$suffixstring
Returns:
null|string

Reimplemented from File.

Definition at line 272 of file ForeignAPIFile.php.

References File\$path, File\getHashPath(), and File\getName().

Referenced by getThumbnails(), and purgeThumbnails().

Returns:
bool|Mixed|string

Reimplemented from File.

Definition at line 228 of file ForeignAPIFile.php.

References wfTimestamp().

Returns:
null|string

Reimplemented from File.

Definition at line 197 of file ForeignAPIFile.php.

ForeignAPIFile::getUser ( method = 'text')
Parameters:
string$method
Returns:
int|null|string

Reimplemented from File.

Definition at line 205 of file ForeignAPIFile.php.

ForeignAPIFile::getWidth ( page = 1)
Parameters:
$pageint
Returns:
int|number

Reimplemented from File.

Definition at line 150 of file ForeignAPIFile.php.

static ForeignAPIFile::newFromTitle ( Title title,
repo 
) [static]
Parameters:
$titleTitle
$repoForeignApiRepo
Returns:
ForeignAPIFile|null

Definition at line 55 of file ForeignAPIFile.php.

References File\$repo, File\$title, array(), Title\getDBkey(), MediaHandler\getMetadataVersion(), getProps(), Title\newFromText(), and true.

static ForeignAPIFile::parseMetadata ( metadata) [static]
Parameters:
$metadataarray
Returns:
array

Definition at line 176 of file ForeignAPIFile.php.

References $ret, array(), and as.

ForeignAPIFile::purgeCache ( options = array())
See also:
File::purgeCache()

Reimplemented from File.

Definition at line 302 of file ForeignAPIFile.php.

References $options, purgeDescriptionPage(), and purgeThumbnails().

ForeignAPIFile::transform ( params,
flags = 0 
)
Parameters:
array$params
int$flags
Returns:
bool|MediaTransformOutput

Reimplemented from File.

Definition at line 113 of file ForeignAPIFile.php.

References $flags, $params, $wgLang, File\canRender(), File\getName(), and global.


Member Data Documentation

ForeignAPIFile::$mExists [private]

Definition at line 31 of file ForeignAPIFile.php.

ForeignAPIFile::$repoClass = 'ForeignApiRepo' [protected]

Required Repository class type.

Reimplemented from File.

Definition at line 33 of file ForeignAPIFile.php.


The documentation for this class was generated from the following file: