[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/media/ -> MediaTransformOutput.php (summary)

Base class for the output of file transformation methods. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 476 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

ThumbnailImage:: (2 methods):
  __construct()
  toHtml()

MediaTransformError:: (5 methods):
  __construct()
  toHtml()
  toText()
  getHtmlMsg()
  isError()

TransformParameterError:: (1 method):
  __construct()

Defines 1 function

  getWidth()
  getHeight()
  getFile()
  getExtension()
  getUrl()
  getStoragePath()
  setStoragePath()
  isError()
  hasFile()
  fileIsSource()
  getLocalCopyPath()
  streamFile()
  linkWrap()
  getDescLinkAttribs()

Class: ThumbnailImage  - X-Ref

Media transform output for images

__construct( $file, $url, $path = false, $parameters = array()   X-Ref
Get a thumbnail object from a file and parameters.
If $path is set to null, the output file is treated as a source copy.
If $path is set to false, no output file will be created.
$parameters should include, as a minimum, (file) 'width' and 'height'.
It may also include a 'page' parameter for multipage files.

param: File $file
param: string $url URL path to the thumb
param: string|bool $path Filesystem path to the thumb
param: array $parameters Associative array of parameters

toHtml( $options = array()   X-Ref
Return HTML <img ... /> tag for the thumbnail, will include
width and height attributes and a blank alt text (as required).

param: array $options Associative array of options. Boolean options
return: string

Class: MediaTransformError  - X-Ref

Basic media transform error class

__construct( $msg, $width, $height )   X-Ref
No description

toHtml( $options = array()   X-Ref
No description

toText()   X-Ref
No description

getHtmlMsg()   X-Ref
No description

isError()   X-Ref
No description

Class: TransformParameterError  - X-Ref

Shortcut class for parameter validation errors

__construct( $params )   X-Ref
No description

Functions
Functions that are not part of a class:

getWidth()   X-Ref

return: int Width of the output box

getHeight()   X-Ref

return: int Height of the output box

getFile()   X-Ref

return: File

getExtension()   X-Ref
Get the final extension of the thumbnail.
Returns false for scripted transformations.

return: string|bool

getUrl()   X-Ref

return: string|bool The thumbnail URL

getStoragePath()   X-Ref

return: string|bool The permanent thumbnail storage path

setStoragePath( $storagePath )   X-Ref

param: string $storagePath The permanent storage path
return: void

isError()   X-Ref
This will be overridden to return true in error classes

return: bool

hasFile()   X-Ref
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.

return: bool

fileIsSource()   X-Ref
Check if the output thumbnail is the same as the source.
This can occur if the requested width was bigger than the source.

return: bool

getLocalCopyPath()   X-Ref
Get the path of a file system copy of the thumbnail.
Callers should never write to this path.

return: string|bool Returns false if there isn't one

streamFile( $headers = array()   X-Ref
Stream the file if there were no errors

param: array $headers Additional HTTP headers to send on success
return: bool Success

linkWrap( $linkAttribs, $contents )   X-Ref
Wrap some XHTML text in an anchor tag with the given attributes

param: array $linkAttribs
param: string $contents
return: string

getDescLinkAttribs( $title = null, $params = array()   X-Ref

param: string $title
param: string|array $params Query parameters to add
return: array



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1