MediaWiki REL1_28
MediaHandler.php
Go to the documentation of this file.
1<?php
24
30abstract class MediaHandler {
31 const TRANSFORM_LATER = 1;
32 const METADATA_GOOD = true;
33 const METADATA_BAD = false;
34 const METADATA_COMPATIBLE = 2; // for old but backwards compatible.
38 const MAX_ERR_LOG_SIZE = 65535;
39
46 static function getHandler( $type ) {
47 return MediaWikiServices::getInstance()
48 ->getMediaHandlerFactory()->getHandler( $type );
49 }
50
55 abstract public function getParamMap();
56
65 abstract public function validateParam( $name, $value );
66
73 abstract public function makeParamString( $params );
74
81 abstract public function parseParamString( $str );
82
90 abstract function normaliseParams( $image, &$params );
91
112 abstract function getImageSize( $image, $path );
113
122 function getMetadata( $image, $path ) {
123 return '';
124 }
125
141 static function getMetadataVersion() {
142 $version = [ '2' ]; // core metadata version
143 Hooks::run( 'GetMetadataVersion', [ &$version ] );
144
145 return implode( ';', $version );
146 }
147
158 function convertMetadataVersion( $metadata, $version = 1 ) {
159 if ( !is_array( $metadata ) ) {
160
161 // unserialize to keep return parameter consistent.
162 MediaWiki\suppressWarnings();
163 $ret = unserialize( $metadata );
164 MediaWiki\restoreWarnings();
165
166 return $ret;
167 }
168
169 return $metadata;
170 }
171
180 return false;
181 }
182
199 function isMetadataValid( $image, $metadata ) {
200 return self::METADATA_GOOD;
201 }
202
235 public function getCommonMetaArray( File $file ) {
236 return false;
237 }
238
251 function getScriptedTransform( $image, $script, $params ) {
252 return false;
253 }
254
265 final function getTransform( $image, $dstPath, $dstUrl, $params ) {
266 return $this->doTransform( $image, $dstPath, $dstUrl, $params, self::TRANSFORM_LATER );
267 }
268
281 abstract function doTransform( $image, $dstPath, $dstUrl, $params, $flags = 0 );
282
291 function getThumbType( $ext, $mime, $params = null ) {
292 $magic = MimeMagic::singleton();
293 if ( !$ext || $magic->isMatchingExtension( $ext, $mime ) === false ) {
294 // The extension is not valid for this MIME type and we do
295 // recognize the MIME type
296 $extensions = $magic->getExtensionsForType( $mime );
297 if ( $extensions ) {
298 return [ strtok( $extensions, ' ' ), $mime ];
299 }
300 }
301
302 // The extension is correct (true) or the MIME type is unknown to
303 // MediaWiki (null)
304 return [ $ext, $mime ];
305 }
306
313 public function getStreamHeaders( $metadata ) {
314 return [];
315 }
316
323 public function canRender( $file ) {
324 return true;
325 }
326
334 public function mustRender( $file ) {
335 return false;
336 }
337
344 public function isMultiPage( $file ) {
345 return false;
346 }
347
354 function pageCount( File $file ) {
355 return false;
356 }
357
364 function isVectorized( $file ) {
365 return false;
366 }
367
376 function isAnimatedImage( $file ) {
377 return false;
378 }
379
387 function canAnimateThumbnail( $file ) {
388 return true;
389 }
390
395 function isEnabled() {
396 return true;
397 }
398
416 $gis = $this->getImageSize( $image, $image->getLocalRefPath() );
417 if ( $gis ) {
418 return [
419 'width' => $gis[0],
420 'height' => $gis[1]
421 ];
422 } else {
423 return false;
424 }
425 }
426
436 return false;
437 }
438
444 public function getEntireText( File $file ) {
445 $numPages = $file->pageCount();
446 if ( !$numPages ) {
447 // Not a multipage document
448 return $this->getPageText( $file, 1 );
449 }
450 $document = '';
451 for ( $i = 1; $i <= $numPages; $i++ ) {
452 $curPage = $this->getPageText( $file, $i );
453 if ( is_string( $curPage ) ) {
454 $document .= $curPage . "\n";
455 }
456 }
457 if ( $document !== '' ) {
458 return $document;
459 }
460 return false;
461 }
462
491 function formatMetadata( $image, $context = false ) {
492 return false;
493 }
494
505 function formatMetadataHelper( $metadataArray, $context = false ) {
506 $result = [
507 'visible' => [],
508 'collapsed' => []
509 ];
510
511 $formatted = FormatMetadata::getFormattedData( $metadataArray, $context );
512 // Sort fields into visible and collapsed
513 $visibleFields = $this->visibleMetadataFields();
514 foreach ( $formatted as $name => $value ) {
515 $tag = strtolower( $name );
517 in_array( $tag, $visibleFields ) ? 'visible' : 'collapsed',
518 'exif',
519 $tag,
520 $value
521 );
522 }
523
524 return $result;
525 }
526
533 protected function visibleMetadataFields() {
535 }
536
560 protected static function addMeta( &$array, $visibility, $type, $id, $value, $param = false ) {
561 $msg = wfMessage( "$type-$id", $param );
562 if ( $msg->exists() ) {
563 $name = $msg->text();
564 } else {
565 // This is for future compatibility when using instant commons.
566 // So as to not display as ugly a name if a new metadata
567 // property is defined that we don't know about
568 // (not a major issue since such a property would be collapsed
569 // by default).
570 wfDebug( __METHOD__ . ' Unknown metadata name: ' . $id . "\n" );
571 $name = wfEscapeWikiText( $id );
572 }
573 $array[$visibility][] = [
574 'id' => "$type-$id",
575 'name' => $name,
576 'value' => $value
577 ];
578 }
579
586 function getShortDesc( $file ) {
587 return self::getGeneralShortDesc( $file );
588 }
589
596 function getLongDesc( $file ) {
597 return self::getGeneralLongDesc( $file );
598 }
599
606 static function getGeneralShortDesc( $file ) {
608
609 return htmlspecialchars( $wgLang->formatSize( $file->getSize() ) );
610 }
611
618 static function getGeneralLongDesc( $file ) {
619 return wfMessage( 'file-info' )->sizeParams( $file->getSize() )
620 ->params( '<span class="mime-type">' . $file->getMimeType() . '</span>' )->parse();
621 }
622
631 public static function fitBoxWidth( $boxWidth, $boxHeight, $maxHeight ) {
632 $idealWidth = $boxWidth * $maxHeight / $boxHeight;
633 $roundedUp = ceil( $idealWidth );
634 if ( round( $roundedUp * $boxHeight / $boxWidth ) > $maxHeight ) {
635 return floor( $idealWidth );
636 } else {
637 return $roundedUp;
638 }
639 }
640
647 function getDimensionsString( $file ) {
648 return '';
649 }
650
661 function parserTransformHook( $parser, $file ) {
662 }
663
674 function verifyUpload( $fileName ) {
675 return Status::newGood();
676 }
677
686 function removeBadFile( $dstPath, $retval = 0 ) {
687 if ( file_exists( $dstPath ) ) {
688 $thumbstat = stat( $dstPath );
689 if ( $thumbstat['size'] == 0 || $retval != 0 ) {
690 $result = unlink( $dstPath );
691
692 if ( $result ) {
693 wfDebugLog( 'thumbnail',
694 sprintf( 'Removing bad %d-byte thumbnail "%s". unlink() succeeded',
695 $thumbstat['size'], $dstPath ) );
696 } else {
697 wfDebugLog( 'thumbnail',
698 sprintf( 'Removing bad %d-byte thumbnail "%s". unlink() failed',
699 $thumbstat['size'], $dstPath ) );
700 }
701
702 return true;
703 }
704 }
705
706 return false;
707 }
708
723 // Do nothing
724 }
725
731 public function canRotate() {
732 return false;
733 }
734
749 public function getRotation( $file ) {
750 return 0;
751 }
752
764 protected function logErrorForExternalProcess( $retval, $err, $cmd ) {
765 # Keep error output limited (bug 57985)
766 $errMessage = trim( substr( $err, 0, self::MAX_ERR_LOG_SIZE ) );
767
768 wfDebugLog( 'thumbnail',
769 sprintf( 'thumbnail failed on %s: error %d "%s" from "%s"',
770 wfHostname(), $retval, $errMessage, $cmd ) );
771 }
772
780 public function getAvailableLanguages( File $file ) {
781 return [];
782 }
783
796 public function getDefaultRenderLanguage( File $file ) {
797 return null;
798 }
799
810 public function getLength( $file ) {
811 return 0.0;
812 }
813
819 public function isExpensiveToThumbnail( $file ) {
820 return false;
821 }
822
829 public function supportsBucketing() {
830 return false;
831 }
832
840 return $params;
841 }
842
868 public function getWarningConfig( $file ) {
869 return null;
870 }
871}
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
unserialize( $serialized)
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfHostname()
Fetch server name for use in error reporting etc.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition File.php:50
pageCount()
Returns the number of pages of a multipage document, or false for documents which aren't multipage do...
Definition File.php:1968
getLocalRefPath()
Get an FS copy or original of this file and return the path.
Definition File.php:432
static getVisibleFields()
Get a list of fields that are visible by default.
static getFormattedData( $tags, $context=false)
Numbers given by Exif user agents are often magical, that is they should be replaced by a detailed ex...
Base media handler class.
normaliseParams( $image, &$params)
Changes the parameter array as necessary, ready for transformation.
getRotation( $file)
On supporting image formats, try to read out the low-level orientation of the file and return the ang...
const METADATA_COMPATIBLE
canRender( $file)
True if the handled types can be transformed.
canAnimateThumbnail( $file)
If the material is animated, we can animate the thumbnail.
verifyUpload( $fileName)
File validation hook called on upload.
visibleMetadataFields()
Get a list of metadata items which should be displayed when the metadata table is collapsed.
static addMeta(&$array, $visibility, $type, $id, $value, $param=false)
This is used to generate an array element for each metadata value That array is then used to generate...
supportsBucketing()
Returns whether or not this handler supports the chained generation of thumbnails according to bucket...
parserTransformHook( $parser, $file)
Modify the parser object post-transform.
static getGeneralLongDesc( $file)
Used instead of getLongDesc if there is no handler registered for file.
getStreamHeaders( $metadata)
Get useful response headers for GET/HEAD requests for a file with the given metadata.
canRotate()
True if the handler can rotate the media.
sanitizeParamsForBucketing( $params)
Returns a normalised params array for which parameters have been cleaned up for bucketing purposes.
getDefaultRenderLanguage(File $file)
On file types that support renderings in multiple languages, which language is used by default if uns...
getLength( $file)
If its an audio file, return the length of the file.
getTransform( $image, $dstPath, $dstUrl, $params)
Get a MediaTransformOutput object representing the transformed output.
getDimensionsString( $file)
Shown in file history box on image description page.
static getHandler( $type)
Get a MediaHandler for a given MIME type from the instance cache.
getCommonMetaArray(File $file)
Get an array of standard (FormatMetadata type) metadata values.
doTransform( $image, $dstPath, $dstUrl, $params, $flags=0)
Get a MediaTransformOutput object representing the transformed output.
getMetadata( $image, $path)
Get handler-specific metadata which will be saved in the img_metadata field.
getPageText(File $image, $page)
Generic getter for text layer.
isAnimatedImage( $file)
The material is an image, and is animated.
isVectorized( $file)
The material is vectorized and thus scaling is lossless.
getImageSize( $image, $path)
Get an image size array like that returned by getimagesize(), or false if it can't be determined.
convertMetadataVersion( $metadata, $version=1)
Convert metadata version.
formatMetadata( $image, $context=false)
Get an array structure that looks like this:
getWarningConfig( $file)
Gets configuration for the file warning message.
logErrorForExternalProcess( $retval, $err, $cmd)
Log an error that occurred in an external process.
isEnabled()
False if the handler is disabled for all files.
parseParamString( $str)
Parse a param string made with makeParamString back into an array.
static getGeneralShortDesc( $file)
Used instead of getShortDesc if there is no handler registered for file.
isMultiPage( $file)
True if the type has multi-page capabilities.
getLongDesc( $file)
Long description.
static fitBoxWidth( $boxWidth, $boxHeight, $maxHeight)
Calculate the largest thumbnail width for a given original file size such that the thumbnail's height...
mustRender( $file)
True if handled types cannot be displayed directly in a browser but can be rendered.
getScriptedTransform( $image, $script, $params)
Get a MediaTransformOutput object representing an alternate of the transformed output which will call...
getMetadataType( $image)
Get a string describing the type of metadata, for display purposes.
isExpensiveToThumbnail( $file)
True if creating thumbnails from the file is large or otherwise resource-intensive.
getEntireText(File $file)
Get the text of the entire document.
getAvailableLanguages(File $file)
Get list of languages file can be viewed in.
filterThumbnailPurgeList(&$files, $options)
Remove files from the purge list.
getShortDesc( $file)
Short description.
makeParamString( $params)
Merge a parameter array into a string appropriate for inclusion in filenames.
formatMetadataHelper( $metadataArray, $context=false)
sorts the visible/invisible field.
validateParam( $name, $value)
Validate a thumbnail parameter at parse time.
getPageDimensions(File $image, $page)
Get an associative array of page dimensions Currently "width" and "height" are understood,...
const TRANSFORM_LATER
getParamMap()
Get an associative array mapping magic word IDs to parameter names.
const MAX_ERR_LOG_SIZE
Max length of error logged by logErrorForExternalProcess()
const METADATA_GOOD
getThumbType( $ext, $mime, $params=null)
Get the thumbnail extension and MIME type for a given source MIME type.
removeBadFile( $dstPath, $retval=0)
Check for zero-sized thumbnails.
isMetadataValid( $image, $metadata)
Check if the metadata string is valid for this handler.
static getMetadataVersion()
Get metadata version.
pageCount(File $file)
Page count for a multi-page document, false if unsupported or unknown.
MediaWikiServices is the service locator for the application scope of MediaWiki.
static singleton()
Get an instance of this class.
Definition MimeMagic.php:29
when a variable name is used in a it is silently declared as a new local masking the global
Definition design.txt:95
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
Definition design.txt:56
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead $parser
Definition hooks.txt:2259
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition hooks.txt:2568
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition hooks.txt:1937
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account incomplete not yet checked for validity & $retval
Definition hooks.txt:268
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check $image
Definition hooks.txt:917
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
Definition hooks.txt:1096
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition hooks.txt:2710
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Definition hooks.txt:1949
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books $tag
Definition hooks.txt:1033
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:304
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
Definition hooks.txt:2534
$extensions
$files
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition injection.txt:37
$context
Definition load.php:50
if( $ext=='php'|| $ext=='php5') $mime
Definition router.php:65
$params