Manual:Hooks/MediaWikiServices

Extensions may use this to replace or decorate services, via the  and. It can also be used to add new services, however the preferred way of doing that is the array.

While not originally intended, this hook can be used to manipulate  configuration settings in test setups before any service is created. In the past, and  have been used for this purpose but those both risk that some service that uses the configuration settings about to be changed has already been instantiatied, and so the change has no effect. Using the MediaWikiServices hook avoids that.

Details

 * $services: MediaWikiServices. See Dependency Injection for more information.