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

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.

References $registry.

Member Function Documentation

◆ getHandler()

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

Definition at line 76 of file MediaHandlerFactory.php.

References $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

◆ $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
Initial value:
=[,,,,,,,,,,,,,]
private const CORE_HANDLERS
'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

Definition at line 55 of file MediaHandlerFactory.php.

Referenced by __construct().


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