MediaWiki REL1_32
|
Object which holds currently registered configuration options. More...
Public Member Functions | |
__construct (\ConfigFactory $configFactory) | |
add ( $name, array $config) | |
Adds the definition of a configuration to this repository. | |
get ( $name) | |
Returns the ConfigItem with the given name, if there's one. | |
getAll () | |
Returns an array of all configuration items saved in this ConfigRepository. | |
getDescriptionOf ( $name) | |
Returns the description of the given config option, This can be either a localized description, if one such, or the (maybe english only) description provided in the definition of the configuration. | |
getPublic () | |
Returns an array of all public configuration options saved in this ConfigRepository. | |
getValueOf ( $name) | |
Returns the current value of the configuration option. | |
has ( $name, $alsoPrivate=false) | |
Returns true, if this repository contains a configuration with a specific name. | |
isEmpty ( $includePrivate=false) | |
Returns true, if there're no elements in this instance, otherwise false. | |
salvage (SalvageableService $other) | |
Re-uses existing Cache objects from $other. | |
Private Attributes | |
ConfigFactory | $configFactory |
array | $configItems |
Object which holds currently registered configuration options.
Definition at line 33 of file ConfigRepository.php.
MediaWiki\Config\ConfigRepository::__construct | ( | \ConfigFactory | $configFactory | ) |
\\ConfigFactory | $configFactory |
Definition at line 46 of file ConfigRepository.php.
References MediaWiki\Config\ConfigRepository\$configFactory.
MediaWiki\Config\ConfigRepository::add | ( | $name, | |
array | $config ) |
Adds the definition of a configuration to this repository.
string | $name | the name of the config |
array | $config | Options of this config. Values are:
|
\ConfigException
Definition at line 154 of file ConfigRepository.php.
References $name, and MediaWiki\Config\ConfigRepository\has().
MediaWiki\Config\ConfigRepository::get | ( | $name | ) |
Returns the ConfigItem with the given name, if there's one.
Throws a ConfigException otherwise.
string | $name | The name of the configuration option to get |
\ConfigException
Definition at line 70 of file ConfigRepository.php.
References $name, and MediaWiki\Config\ConfigRepository\has().
MediaWiki\Config\ConfigRepository::getAll | ( | ) |
Returns an array of all configuration items saved in this ConfigRepository.
This includes all configuration options, including the ones marked as private and public.
Note: This function does not do any permission checks or something similar. You should not use this function, if the output will be available to the public audience! Use ConfigRepository::getPublic() instead.
Definition at line 90 of file ConfigRepository.php.
MediaWiki\Config\ConfigRepository::getDescriptionOf | ( | $name | ) |
Returns the description of the given config option, This can be either a localized description, if one such, or the (maybe english only) description provided in the definition of the configuration.
If both is not provided an empty string is returned.
string | $name | The name of the configuration option to get the description of |
Definition at line 128 of file ConfigRepository.php.
References $name, and wfMessage().
MediaWiki\Config\ConfigRepository::getPublic | ( | ) |
Returns an array of all public configuration options saved in this ConfigRepository.
Definition at line 99 of file ConfigRepository.php.
MediaWiki\Config\ConfigRepository::getValueOf | ( | $name | ) |
Returns the current value of the configuration option.
If no ConfigRegistry was provided when the config was added to the repository, the default value will be returned.
string | $name | The name of the configuration option to get the value of |
\ConfigException
Definition at line 111 of file ConfigRepository.php.
References $name.
MediaWiki\Config\ConfigRepository::has | ( | $name, | |
$alsoPrivate = false ) |
Returns true, if this repository contains a configuration with a specific name.
string | $name | The name of the config to check the existence of |
bool | $alsoPrivate | If set to true, will check the private config options, too |
Definition at line 57 of file ConfigRepository.php.
Referenced by MediaWiki\Config\ConfigRepository\add(), and MediaWiki\Config\ConfigRepository\get().
MediaWiki\Config\ConfigRepository::isEmpty | ( | $includePrivate = false | ) |
Returns true, if there're no elements in this instance, otherwise false.
bool | $includePrivate | Whether configuration options, that are marked as private should be included in this check. |
Definition at line 174 of file ConfigRepository.php.
MediaWiki\Config\ConfigRepository::salvage | ( | SalvageableService | $other | ) |
Re-uses existing Cache objects from $other.
Cache objects are only re-used if the registered factory function for both is the same.
SalvageableService | $other | The object to salvage state from. $other must have the exact same type as $this. |
Implements MediaWiki\Services\SalvageableService.
Definition at line 191 of file ConfigRepository.php.
References add.
|
private |
Definition at line 35 of file ConfigRepository.php.
Referenced by MediaWiki\Config\ConfigRepository\__construct().
|
private |
Definition at line 38 of file ConfigRepository.php.