Go to the documentation of this file.
25 use Wikimedia\ObjectFactory;
144 if ( isset( $this->config[$key] ) ) {
145 $this->config[$key] = array_merge( $this->config[$key],
$value );
147 $this->config[$key] =
$value;
160 $this->singletons = [
179 if ( !isset( $this->singletons[
'loggers'][$channel] ) ) {
182 $spec = $this->config[
'loggers'][$channel] ?? $this->config[
'loggers'][
'@default'];
185 $this->singletons[
'loggers'][$channel] = $monolog;
188 return $this->singletons[
'loggers'][$channel];
198 $obj =
new Logger( $channel );
200 if ( isset( $spec[
'calls'] ) ) {
201 foreach ( $spec[
'calls']
as $method => $margs ) {
202 $obj->$method( ...$margs );
206 if ( isset( $spec[
'processors'] ) ) {
207 foreach ( $spec[
'processors']
as $processor ) {
208 $obj->pushProcessor( $this->
getProcessor( $processor ) );
212 if ( isset( $spec[
'handlers'] ) ) {
214 $obj->pushHandler( $this->
getHandler( $handler ) );
226 if ( !isset( $this->singletons[
'processors'][
$name] ) ) {
227 $spec = $this->config[
'processors'][
$name];
228 $processor = ObjectFactory::getObjectFromSpec( $spec );
229 $this->singletons[
'processors'][
$name] = $processor;
231 return $this->singletons[
'processors'][
$name];
240 if ( !isset( $this->singletons[
'handlers'][
$name] ) ) {
241 $spec = $this->config[
'handlers'][
$name];
242 $handler = ObjectFactory::getObjectFromSpec( $spec );
243 if ( isset( $spec[
'formatter'] ) ) {
248 if ( isset( $spec[
'buffer'] ) && $spec[
'buffer'] ) {
253 return $this->singletons[
'handlers'][
$name];
262 if ( !isset( $this->singletons[
'formatters'][
$name] ) ) {
263 $spec = $this->config[
'formatters'][
$name];
264 $formatter = ObjectFactory::getObjectFromSpec( $spec );
265 $this->singletons[
'formatters'][
$name] = $formatter;
267 return $this->singletons[
'formatters'][
$name];
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
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
Allows to change the fields on the form that will be generated $name
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 set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
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