MediaWiki REL1_31
MediaHandlerFactory Class Reference

Class to construct MediaHandler objects. More...

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.
 
array $registry
 

Static Private Attributes

static array $coreHandlers
 Default, MediaWiki core media handlers.
 

Detailed Description

Class to construct MediaHandler objects.

Since
1.28

Definition at line 29 of file MediaHandlerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaHandlerFactory::__construct ( array $registry)

Definition at line 64 of file MediaHandlerFactory.php.

Member Function Documentation

◆ getHandler()

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

Definition at line 80 of file MediaHandlerFactory.php.

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

◆ getHandlerClass()

MediaHandlerFactory::getHandlerClass ( $type)
protected

Definition at line 68 of file MediaHandlerFactory.php.

References $type.

Referenced by getHandler().

Member Data Documentation

◆ $coreHandlers

array MediaHandlerFactory::$coreHandlers
staticprivate
Initial value:
= [
'image/jpeg' => JpegHandler::class,
'image/png' => PNGHandler::class,
'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,
]

Default, MediaWiki core media handlers.

Definition at line 36 of file MediaHandlerFactory.php.

◆ $handlers

MediaHandler [] MediaHandlerFactory::$handlers
private

Instance cache of MediaHandler objects by mimetype.

Definition at line 62 of file MediaHandlerFactory.php.

◆ $registry

array MediaHandlerFactory::$registry
private

Definition at line 55 of file MediaHandlerFactory.php.


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