MediaWiki  REL1_24
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

MediaHandler $handler
 *

Protected Attributes

array $dims
 Dimension data *.
bool string $metadata
 Handler-specific metadata which will be saved in the img_metadata field *.
bool string $mime
 *
string $path
 *
Title $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:
Title | bool$title
FileRepo | bool$repo
string | bool$path
string | bool$mime

Definition at line 77 of file UnregisteredLocalFile.php.


Member Function Documentation

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

Definition at line 107 of file UnregisteredLocalFile.php.

Parameters:
int$page
Returns:
int

Reimplemented from File.

Definition at line 132 of file UnregisteredLocalFile.php.

Parameters:
string$filename
Returns:
array|bool

Reimplemented from File.

Definition at line 154 of file UnregisteredLocalFile.php.

Returns:
bool

Reimplemented from File.

Definition at line 165 of file UnregisteredLocalFile.php.

Returns:
bool|string

Reimplemented from File.

Definition at line 141 of file UnregisteredLocalFile.php.

Returns:
bool|int

Reimplemented from File.

Definition at line 192 of file UnregisteredLocalFile.php.

Returns:
bool|string

Definition at line 180 of file UnregisteredLocalFile.php.

Parameters:
int$page
Returns:
int

Reimplemented from File.

Definition at line 122 of file UnregisteredLocalFile.php.

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

Definition at line 54 of file UnregisteredLocalFile.php.

References $mime, and $path.

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

Definition at line 63 of file UnregisteredLocalFile.php.

References File\$repo, $title, and false.

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:
FSFile$fsFile
Returns:
void

Definition at line 206 of file UnregisteredLocalFile.php.


Member Data Documentation

array UnregisteredLocalFile::$dims [protected]

Dimension data *.

Definition at line 43 of file UnregisteredLocalFile.php.

MediaHandler UnregisteredLocalFile::$handler

*

Reimplemented from File.

Definition at line 47 of file UnregisteredLocalFile.php.

bool string UnregisteredLocalFile::$metadata [protected]

Handler-specific metadata which will be saved in the img_metadata field *.

Definition at line 45 of file UnregisteredLocalFile.php.

bool string UnregisteredLocalFile::$mime [protected]

*

Definition at line 41 of file UnregisteredLocalFile.php.

Referenced by newFromPath().

string UnregisteredLocalFile::$path [protected]

*

Reimplemented from File.

Definition at line 39 of file UnregisteredLocalFile.php.

Referenced by newFromPath().

Title UnregisteredLocalFile::$title [protected]

*

Reimplemented from File.

Definition at line 37 of file UnregisteredLocalFile.php.

Referenced by newFromTitle().


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