MediaWiki
1.33.0
|
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. More... | |
get ( $name) | |
Returns the ConfigItem with the given name, if there's one. More... | |
getAll () | |
Returns an array of all configuration items saved in this ConfigRepository. More... | |
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. More... | |
getPublic () | |
Returns an array of all public configuration options saved in this ConfigRepository. More... | |
getValueOf ( $name) | |
Returns the current value of the configuration option. More... | |
has ( $name, $alsoPrivate=false) | |
Returns true, if this repository contains a configuration with a specific name. More... | |
isEmpty ( $includePrivate=false) | |
Returns true, if there're no elements in this instance, otherwise false. More... | |
salvage (SalvageableService $other) | |
Re-uses existing Cache objects from $other. More... | |
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:
|
Definition at line 152 of file ConfigRepository.php.
References MediaWiki\$config, $name, and MediaWiki\Config\ConfigRepository\has().
Referenced by MediaWiki\Config\ConfigRepository\salvage().
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 |
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 88 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 126 of file ConfigRepository.php.
References MediaWiki\$config, $name, and wfMessage().
MediaWiki\Config\ConfigRepository::getPublic | ( | ) |
Returns an array of all public configuration options saved in this ConfigRepository.
Definition at line 97 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 |
Definition at line 109 of file ConfigRepository.php.
References MediaWiki\$config, $name, and Config\get().
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.
References $name.
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 172 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 Wikimedia\Services\SalvageableService.
Definition at line 189 of file ConfigRepository.php.
References $name, MediaWiki\Config\ConfigRepository\add(), as, and class.
|
private |
Definition at line 35 of file ConfigRepository.php.
Referenced by MediaWiki\Config\ConfigRepository\__construct().
|
private |
Definition at line 38 of file ConfigRepository.php.