MediaWiki
1.28.0
|
Base class for the output of MediaHandler::doTransform() and File::transform(). More...
Public Member Functions | |
fileIsSource () | |
Check if the output thumbnail is the same as the source. More... | |
getDescLinkAttribs ($title=null, $params=[]) | |
getExtension () | |
Get the final extension of the thumbnail. More... | |
getFile () | |
getHeight () | |
getLocalCopyPath () | |
Get the path of a file system copy of the thumbnail. More... | |
getStoragePath () | |
getUrl () | |
getWidth () | |
hasFile () | |
Check if an output thumbnail file actually exists. More... | |
isError () | |
This will be overridden to return true in error classes. More... | |
setStoragePath ($storagePath) | |
streamFile ($headers=[]) | |
Stream the file if there were no errors. More... | |
streamFileWithStatus ($headers=[]) | |
Stream the file if there were no errors. More... | |
toHtml ($options=[]) | |
Fetch HTML for this transform output. More... | |
Public Attributes | |
array | $responsiveUrls = [] |
Associative array mapping optional supplementary image files from pixel density (eg 1.5 or 2) to additional URLs. More... | |
Protected Member Functions | |
linkWrap ($linkAttribs, $contents) | |
Wrap some XHTML text in an anchor tag with the given attributes. More... | |
Protected Attributes | |
File | $file |
int | $height |
Image height. More... | |
bool string | $lang |
Language code, false if not set. More... | |
bool string | $page |
bool string | $path |
Filesystem path to the thumb. More... | |
bool string | $storagePath = false |
Permanent storage path. More... | |
string | $url |
URL path to the thumb. More... | |
int | $width |
Image width. More... | |
Base class for the output of MediaHandler::doTransform() and File::transform().
Definition at line 29 of file MediaTransformOutput.php.
MediaTransformOutput::fileIsSource | ( | ) |
Check if the output thumbnail is the same as the source.
This can occur if the requested width was bigger than the source.
Definition at line 167 of file MediaTransformOutput.php.
References isError().
MediaTransformOutput::getDescLinkAttribs | ( | $title = null , |
|
$params = [] |
|||
) |
string | $title | |
string | array | $params | Query parameters to add |
Definition at line 243 of file MediaTransformOutput.php.
References $attribs, $lang, $page, $params, $query, $title, file, page, and wfArrayToCgi().
Referenced by ThumbnailImage\toHtml().
MediaTransformOutput::getExtension | ( | ) |
Get the final extension of the thumbnail.
Returns false for scripted transformations.
Definition at line 85 of file MediaTransformOutput.php.
References FileBackend\extensionFromPath().
MediaTransformOutput::getFile | ( | ) |
MediaTransformOutput::getHeight | ( | ) |
Definition at line 69 of file MediaTransformOutput.php.
References $height.
MediaTransformOutput::getLocalCopyPath | ( | ) |
Get the path of a file system copy of the thumbnail.
Callers should never write to this path.
Definition at line 177 of file MediaTransformOutput.php.
References $path, file, isError(), and FileBackend\isStoragePath().
Referenced by streamFileWithStatus().
MediaTransformOutput::getStoragePath | ( | ) |
Definition at line 99 of file MediaTransformOutput.php.
References $storagePath.
MediaTransformOutput::getUrl | ( | ) |
Definition at line 92 of file MediaTransformOutput.php.
References $url.
MediaTransformOutput::getWidth | ( | ) |
Definition at line 62 of file MediaTransformOutput.php.
References $width.
MediaTransformOutput::hasFile | ( | ) |
Check if an output thumbnail file actually exists.
This will return false if there was an error, the thumbnail is to be handled client-side only, or if transformation was deferred via TRANSFORM_LATER. This file may exist as a new file in /tmp, a file in permanent storage, or even refer to the original.
Definition at line 155 of file MediaTransformOutput.php.
References isError().
MediaTransformOutput::isError | ( | ) |
This will be overridden to return true in error classes.
Definition at line 140 of file MediaTransformOutput.php.
Referenced by fileIsSource(), getLocalCopyPath(), and hasFile().
|
protected |
Wrap some XHTML text in an anchor tag with the given attributes.
array | $linkAttribs | |
string | $contents |
Definition at line 230 of file MediaTransformOutput.php.
References Xml\tags().
Referenced by ThumbnailImage\toHtml().
MediaTransformOutput::setStoragePath | ( | $storagePath | ) |
string | $storagePath | The permanent storage path |
Definition at line 107 of file MediaTransformOutput.php.
References $storagePath.
MediaTransformOutput::streamFile | ( | $headers = [] | ) |
Stream the file if there were no errors.
array | $headers | Additional HTTP headers to send on success |
Definition at line 219 of file MediaTransformOutput.php.
References streamFileWithStatus().
MediaTransformOutput::streamFileWithStatus | ( | $headers = [] | ) |
Stream the file if there were no errors.
array | $headers | Additional HTTP headers to send on success |
Definition at line 200 of file MediaTransformOutput.php.
References $success, file, getLocalCopyPath(), FileBackend\isStoragePath(), StatusValue\newFatal(), StatusValue\newGood(), and StreamFile\stream().
Referenced by streamFile().
|
abstract |
Fetch HTML for this transform output.
array | $options | Associative array of options. Boolean options should be indicated with a value of true for true, and false or absent for false. |
alt Alternate text or caption desc-link Boolean, show a description link file-link Boolean, show a file download link custom-url-link Custom URL to link to custom-title-link Custom Title object to link to valign vertical-align property, if the output is an inline element img-class Class applied to the "<img>" tag, if there is such a tag
For images, desc-link and file-link are implemented as a click-through. For sounds and videos, they may be displayed in other ways.
|
protected |
Definition at line 36 of file MediaTransformOutput.php.
Referenced by ThumbnailImage\__construct(), and getFile().
|
protected |
Image height.
Definition at line 42 of file MediaTransformOutput.php.
Referenced by MediaTransformError\__construct(), getHeight(), and ThumbnailImage\toHtml().
|
protected |
Language code, false if not set.
Definition at line 54 of file MediaTransformOutput.php.
Referenced by getDescLinkAttribs().
|
protected |
Definition at line 48 of file MediaTransformOutput.php.
Referenced by getDescLinkAttribs().
|
protected |
Filesystem path to the thumb.
Definition at line 51 of file MediaTransformOutput.php.
Referenced by ThumbnailImage\__construct(), and getLocalCopyPath().
array MediaTransformOutput::$responsiveUrls = [] |
Associative array mapping optional supplementary image files from pixel density (eg 1.5 or 2) to additional URLs.
Definition at line 33 of file MediaTransformOutput.php.
Referenced by ThumbnailImage\toHtml().
Permanent storage path.
Definition at line 57 of file MediaTransformOutput.php.
Referenced by getStoragePath(), and setStoragePath().
|
protected |
URL path to the thumb.
Definition at line 45 of file MediaTransformOutput.php.
Referenced by ThumbnailImage\__construct(), getUrl(), and ThumbnailImage\toHtml().
|
protected |
Image width.
Definition at line 39 of file MediaTransformOutput.php.
Referenced by MediaTransformError\__construct(), getWidth(), and ThumbnailImage\toHtml().