MediaWiki  master
MediaHandlerFactory Class Reference

Class to construct MediaHandler objects. More...

Collaboration diagram for MediaHandlerFactory:

Public Member Functions

 __construct (LoggerInterface $logger, array $registry)
 
 getHandler ( $type)
 

Protected Member Functions

 getHandlerClass ( $type)
 

Private Attributes

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

Detailed Description

Class to construct MediaHandler objects.

Since
1.28

Definition at line 31 of file MediaHandlerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaHandlerFactory::__construct ( LoggerInterface  $logger,
array  $registry 
)
Parameters
LoggerInterface$logger
array$registry

Definition at line 73 of file MediaHandlerFactory.php.

References $logger, and $registry.

Member Function Documentation

◆ getHandler()

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

Definition at line 89 of file MediaHandlerFactory.php.

References $type, and getHandlerClass().

◆ getHandlerClass()

MediaHandlerFactory::getHandlerClass (   $type)
protected

Definition at line 81 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 67 of file MediaHandlerFactory.php.

◆ $logger

LoggerInterface MediaHandlerFactory::$logger
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
'image/jp2' => Jpeg2000Handler::class
'image/jpx' => Jpeg2000Handler::class

Definition at line 57 of file MediaHandlerFactory.php.

Referenced by __construct().

◆ $registry

array MediaHandlerFactory::$registry
private

Definition at line 60 of file MediaHandlerFactory.php.

Referenced by __construct().


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