4use InvalidArgumentException;
106 $this->serviceInstantiators = [];
108 $this->services = [];
109 $this->destroyed =
true;
118 foreach ( $wiringFiles as $file ) {
120 $wiring = require
$file;
122 Assert::postcondition(
124 "Wiring file $file is expected to return an array!"
157 $container->serviceInstantiators,
162 $this->serviceInstantiators,
167 array_keys( $container->serviceManipulators ),
171 foreach ( $newManipulators as $name ) {
172 if (
isset( $this->serviceManipulators[$name] ) ) {
174 $this->serviceManipulators[$name],
175 $container->serviceManipulators[$name]
178 $this->serviceManipulators[
$name] = $container->serviceManipulators[
$name];
192 return isset( $this->serviceInstantiators[$name] );
215 return $this->services[
$name] ??
null;
222 return array_keys( $this->serviceInstantiators );
240 Assert::parameterType(
'string', $name,
'$name' );
269 Assert::parameterType(
'string', $name,
'$name' );
275 if (
isset( $this->services[$name] ) ) {
280 unset( $this->disabled[$name] );
310 Assert::parameterType(
'string', $name,
'$name' );
316 if (
isset( $this->services[$name] ) ) {
345 $this->disabled[
$name] =
true;
372 Assert::parameterType(
'string', $name,
'$name' );
377 $instance->destroy();
380 unset( $this->services[$name] );
381 unset( $this->disabled[$name] );
405 if ( $this->destroyed ) {
409 if (
isset( $this->disabled[$name] ) ) {
413 if ( !
isset( $this->services[$name] ) ) {
417 return $this->services[
$name];
427 if (
isset( $this->serviceInstantiators[$name] ) ) {
428 $service = ( $this->serviceInstantiators[
$name] )(
430 ...$this->extraInstantiationParams
433 if (
isset( $this->serviceManipulators[$name] ) ) {
434 foreach ( $this->serviceManipulators[$name] as $callback ) {
437 array_merge( [ $service, $this ], $this->extraInstantiationParams )
443 if (
$ret !==
null ) {
463 return isset( $this->disabled[$name] );
471class_alias( ServiceContainer::class,
'MediaWiki\Services\ServiceContainer' );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
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
Allows to change the fields on the form that will be generated $name
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))
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file