MediaWiki
REL1_24
|
Factory class to create Config objects. More...
Public Member Functions | |
makeConfig ($name) | |
Create a given Config using the registered callback for $name. | |
register ($name, $callback) | |
Register a new config factory function Will override if it's already registered. | |
Static Public Member Functions | |
static | destroyDefaultInstance () |
Destroy the default instance Should only be called inside unit tests. | |
static | getDefaultInstance () |
Protected Attributes | |
array | $configs = array() |
Config objects that have already been created name => Config object. | |
array | $factoryFunctions = array() |
Map of config name => callback. | |
Static Private Attributes | |
static | $self |
static ConfigFactory::destroyDefaultInstance | ( | ) | [static] |
Destroy the default instance Should only be called inside unit tests.
MWException |
Definition at line 64 of file ConfigFactory.php.
Referenced by ConfigFactoryTest\tearDown(), and ConfigFactoryTest\testGetDefaultInstance().
static ConfigFactory::getDefaultInstance | ( | ) | [static] |
Definition at line 47 of file ConfigFactory.php.
References $name, $self, $self, as, and global.
Referenced by PageArchive\__construct(), MimeMagic\__construct(), CleanupRemovedModules\execute(), ResourceLoaderContext\newDummyContext(), and ConfigFactoryTest\testGetDefaultInstance().
ConfigFactory::makeConfig | ( | $ | name | ) |
Create a given Config using the registered callback for $name.
If an object was already created, the same Config object is returned.
string | $name | Name of the extension/component you want a Config object for 'main' is used for core |
ConfigException | If a factory function isn't registered for $name |
UnexpectedValueException | If the factory function returns a non-Config object |
Definition at line 95 of file ConfigFactory.php.
ConfigFactory::register | ( | $ | name, |
$ | callback | ||
) |
Register a new config factory function Will override if it's already registered.
string | $name | |
callable | $callback | That takes this ConfigFactory as an argument |
InvalidArgumentException | If an invalid callback is provided |
Definition at line 79 of file ConfigFactory.php.
Config objects that have already been created name => Config object.
Definition at line 40 of file ConfigFactory.php.
Map of config name => callback.
Definition at line 34 of file ConfigFactory.php.
ConfigFactory::$self [static, private] |
Definition at line 45 of file ConfigFactory.php.
Referenced by getDefaultInstance().