MediaWiki  1.29.1
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...
 
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

◆ __construct()

MediaHandlerFactory::__construct ( array  $registry)

Definition at line 64 of file MediaHandlerFactory.php.

References $coreHandlers, and $registry.

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

Reimplemented in MockMediaHandlerFactory.

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.

Referenced by __construct().

◆ $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.

Referenced by __construct().


The documentation for this class was generated from the following file:
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52