MediaWiki  REL1_22
UnregisteredLocalFile Class Reference

A file object referring to either a standalone local file, or a file in a local repository with no database, for example an FileRepo repository. More...

Inheritance diagram for UnregisteredLocalFile:
Collaboration diagram for UnregisteredLocalFile:

List of all members.

Public Member Functions

 __construct ($title=false, $repo=false, $path=false, $mime=false)
 Create an UnregisteredLocalFile based on a path or a (title,repo) pair.
 getHeight ($page=1)
 getImageSize ($filename)
 getMetadata ()
 getMimeType ()
 getSize ()
 getURL ()
 getWidth ($page=1)
 setLocalReference (FSFile $fsFile)
 Optimize getLocalRefPath() by using an existing local reference.

Static Public Member Functions

static newFromPath ($path, $mime)
static newFromTitle ($title, $repo)

Public Attributes

 $dims
MediaHandler $handler
 $metadata
 $mime
 $path
 $title

Private Member Functions

 cachePageDimensions ($page=1)

Detailed Description

A file object referring to either a standalone local file, or a file in a local repository with no database, for example an FileRepo repository.

Read-only.

TODO: Currently it doesn't really work in the repository role, there are lots of functions missing. It is used by the WebStore extension in the standalone role.

Definition at line 36 of file UnregisteredLocalFile.php.


Constructor & Destructor Documentation

UnregisteredLocalFile::__construct ( title = false,
repo = false,
path = false,
mime = false 
)

Create an UnregisteredLocalFile based on a path or a (title,repo) pair.

A FileRepo object is not required here, unlike most other File classes.

Exceptions:
MWException
Parameters:
$titleTitle|bool
$repoFileRepo|bool
$pathstring|bool
$mimestring|bool

Definition at line 71 of file UnregisteredLocalFile.php.


Member Function Documentation

UnregisteredLocalFile::cachePageDimensions ( page = 1) [private]
Parameters:
$pageint
Returns:
bool

Definition at line 100 of file UnregisteredLocalFile.php.

Parameters:
$pageint
Returns:
number

Reimplemented from File.

Definition at line 123 of file UnregisteredLocalFile.php.

Parameters:
$filenameString
Returns:
Array|bool

Reimplemented from File.

Definition at line 143 of file UnregisteredLocalFile.php.

Returns:
bool

Reimplemented from File.

Definition at line 153 of file UnregisteredLocalFile.php.

Returns:
bool|string

Reimplemented from File.

Definition at line 131 of file UnregisteredLocalFile.php.

Returns:
bool|int

Reimplemented from File.

Definition at line 179 of file UnregisteredLocalFile.php.

Returns:
bool|string

Definition at line 167 of file UnregisteredLocalFile.php.

Parameters:
$pageint
Returns:
number

Reimplemented from File.

Definition at line 114 of file UnregisteredLocalFile.php.

static UnregisteredLocalFile::newFromPath ( path,
mime 
) [static]
Parameters:
string$pathStorage path
$mimestring
Returns:
UnregisteredLocalFile

Definition at line 48 of file UnregisteredLocalFile.php.

static UnregisteredLocalFile::newFromTitle ( title,
repo 
) [static]
Parameters:
$title
$repo
Returns:
UnregisteredLocalFile

Definition at line 57 of file UnregisteredLocalFile.php.

Optimize getLocalRefPath() by using an existing local reference.

The file at the path of $fsFile should not be deleted (or at least not until the end of the request). This is mostly a performance hack.

Parameters:
$fsFileFSFile
Returns:
void

Definition at line 192 of file UnregisteredLocalFile.php.


Member Data Documentation

UnregisteredLocalFile::$dims

Definition at line 37 of file UnregisteredLocalFile.php.

MediaHandler UnregisteredLocalFile::$handler

Reimplemented from File.

Definition at line 41 of file UnregisteredLocalFile.php.

UnregisteredLocalFile::$metadata

Definition at line 37 of file UnregisteredLocalFile.php.

UnregisteredLocalFile::$mime

Definition at line 37 of file UnregisteredLocalFile.php.

UnregisteredLocalFile::$path

Reimplemented from File.

Definition at line 37 of file UnregisteredLocalFile.php.

UnregisteredLocalFile::$title

Reimplemented from File.

Definition at line 37 of file UnregisteredLocalFile.php.


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