MediaWiki
REL1_24
|
Public Member Functions | |
__construct ($repo, $path, $key) | |
A LocalFile wrapper around a file that has been temporarily stashed, so we can do things like create thumbnails for it. | |
exists () | |
Returns true if file exists in the repository. | |
getDescriptionUrl () | |
A method needed by the file transforming and scaling routines in File.php We do not necessarily care about doing the description at this point However, we also can't return the empty string, as the rest of MediaWiki demands this (and calls to imagemagick convert require it to be there) | |
getFileKey () | |
Getter for file key (the unique id by which this file's location & metadata is stored in the db) | |
getFullUrl () | |
Parent classes use this method, for no obvious reason, to return the path (relative to wiki root, I assume). | |
getThumbPath ($thumbName=false) | |
Get the path for the thumbnail (actually any transformation of this file) The actual argument is the result of thumbName although we seem to have buggy code elsewhere that expects a boolean 'suffix'. | |
getThumbUrl ($thumbName=false) | |
Get a URL to access the thumbnail This is required because the model of how files work requires that the thumbnail urls be predictable. | |
getUrl () | |
Return the URL of the file, if for some reason we wanted to download it We tend not to do this for the original file, but we do want thumb icons. | |
getUrlName () | |
The basename for the URL, which we want to not be related to the filename. | |
remove () | |
Remove the associated temporary file. | |
thumbName ($params, $flags=0) | |
Return the file/url base name of a thumbnail with the specified parameters. | |
Protected Attributes | |
$url | |
The URL corresponding to one of the four basic zones *. | |
Private Member Functions | |
getSpecialUrl ($subPage) | |
Helper function -- given a 'subpage', return the local URL, e.g. | |
Private Attributes | |
$fileKey | |
$urlName |
Definition at line 540 of file UploadStash.php.
UploadStashFile::__construct | ( | $ | repo, |
$ | path, | ||
$ | key | ||
) |
A LocalFile wrapper around a file that has been temporarily stashed, so we can do things like create thumbnails for it.
Arguably UnregisteredLocalFile should be handling its own file repo but that class is a bit retarded currently.
FileRepo | $repo | Repository where we should find the path |
string | $path | Path to file |
string | $key | Key to store the path and any stashed data under |
Definition at line 557 of file UploadStash.php.
Returns true if file exists in the repository.
Overridden by LocalFile to avoid unnecessary stat calls.
Reimplemented from File.
Definition at line 720 of file UploadStash.php.
A method needed by the file transforming and scaling routines in File.php We do not necessarily care about doing the description at this point However, we also can't return the empty string, as the rest of MediaWiki demands this (and calls to imagemagick convert require it to be there)
Reimplemented from File.
Definition at line 596 of file UploadStash.php.
Getter for file key (the unique id by which this file's location & metadata is stored in the db)
Definition at line 703 of file UploadStash.php.
Parent classes use this method, for no obvious reason, to return the path (relative to wiki root, I assume).
But with this class, the URL is unrelated to the path.
Reimplemented from File.
Definition at line 693 of file UploadStash.php.
UploadStashFile::getSpecialUrl | ( | $ | subPage | ) | [private] |
Helper function -- given a 'subpage', return the local URL, e.g.
/wiki/Special:UploadStash/subpage
string | $subPage |
Definition at line 638 of file UploadStash.php.
UploadStashFile::getThumbPath | ( | $ | thumbName = false | ) |
Get the path for the thumbnail (actually any transformation of this file) The actual argument is the result of thumbName although we seem to have buggy code elsewhere that expects a boolean 'suffix'.
string | $thumbName | Name of thumbnail (e.g. "120px-123456.jpg" ), or false to just get the path |
Reimplemented from File.
Definition at line 610 of file UploadStash.php.
UploadStashFile::getThumbUrl | ( | $ | thumbName = false | ) |
Get a URL to access the thumbnail This is required because the model of how files work requires that the thumbnail urls be predictable.
However, in our model the URL is not based on the filename (that's hidden in the db)
string | $thumbName | Basename of thumbnail file -- however, we don't want to use the file exactly |
Reimplemented from File.
Definition at line 652 of file UploadStash.php.
Return the URL of the file, if for some reason we wanted to download it We tend not to do this for the original file, but we do want thumb icons.
Reimplemented from File.
Definition at line 678 of file UploadStash.php.
The basename for the URL, which we want to not be related to the filename.
Will also be used as the lookup key for a thumbnail file.
Definition at line 664 of file UploadStash.php.
Remove the associated temporary file.
Definition at line 711 of file UploadStash.php.
UploadStashFile::thumbName | ( | $ | params, |
$ | flags = 0 |
||
) |
Return the file/url base name of a thumbnail with the specified parameters.
We override this because we want to use the pretty url name instead of the ugly file name.
array | $params | Handler-specific parameters |
int | $flags | Bitfield that supports THUMB_* constants |
Reimplemented from File.
Definition at line 628 of file UploadStash.php.
UploadStashFile::$fileKey [private] |
Definition at line 541 of file UploadStash.php.
UploadStashFile::$url [protected] |
The URL corresponding to one of the four basic zones *.
Reimplemented from File.
Definition at line 543 of file UploadStash.php.
UploadStashFile::$urlName [private] |
Definition at line 542 of file UploadStash.php.