MediaWiki  1.28.0
MediaHandlerFactory Class Reference

Class to construct MediaHandler objects. More...

Inheritance diagram for MediaHandlerFactory:
Collaboration diagram for MediaHandlerFactory:

Public Member Functions

 __construct (array $registry)
 
 getHandler ($type)
 

Protected Member Functions

 getHandlerClass ($type)
 

Private Attributes

MediaHandler[] $handlers
 Instance cache of MediaHandler objects by mimetype. More...
 
static array array $registry
 

Static Private Attributes

static array $coreHandlers
 Default, MediaWiki core media handlers. More...
 

Detailed Description

Class to construct MediaHandler objects.

Since
1.28

Definition at line 29 of file MediaHandlerFactory.php.

Constructor & Destructor Documentation

MediaHandlerFactory::__construct ( array  $registry)

Definition at line 64 of file MediaHandlerFactory.php.

Member Function Documentation

MediaHandlerFactory::getHandler (   $type)
Parameters
string$typemimetype
Returns
bool|MediaHandler

Definition at line 80 of file MediaHandlerFactory.php.

References $handler, $type, getHandlerClass(), and wfDebug().

MediaHandlerFactory::getHandlerClass (   $type)
protected

Definition at line 68 of file MediaHandlerFactory.php.

References $type.

Referenced by getHandler().

Member Data Documentation

array MediaHandlerFactory::$coreHandlers
staticprivate
Initial value:
= [
'image/jpeg' => JpegHandler::class

Default, MediaWiki core media handlers.

Definition at line 36 of file MediaHandlerFactory.php.

MediaHandler [] MediaHandlerFactory::$handlers
private

Instance cache of MediaHandler objects by mimetype.

Definition at line 62 of file MediaHandlerFactory.php.

array array MediaHandlerFactory::$registry
private
Initial value:
'image/gif' => GIFHandler::class,
'image/tiff' => TiffHandler::class,
'image/webp' => WebPHandler::class,
'image/x-ms-bmp' => BmpHandler::class,
'image/x-bmp' => BmpHandler::class,
'image/x-xcf' => XCFHandler::class,
'image/svg+xml' => SvgHandler::class,
'image/svg' => SvgHandler::class,
'image/vnd.djvu' => DjVuHandler::class,
'image/x.djvu' => DjVuHandler::class,
'image/x-djvu' => DjVuHandler::class,
]

Definition at line 38 of file MediaHandlerFactory.php.


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