MediaWiki  master
MediaWiki\Settings\Config\GlobalConfigBuilder Class Reference
Inheritance diagram for MediaWiki\Settings\Config\GlobalConfigBuilder:
Collaboration diagram for MediaWiki\Settings\Config\GlobalConfigBuilder:

Public Member Functions

 __construct (string $prefix=self::DEFAULT_PREFIX)
 
 build ()
 Build the resulting Config object. More...
 
 set (string $key, $value, MergeStrategy $mergeStrategy=null)
 Set the configuration $key to $value. More...
 
 setDefault (string $key, $value, MergeStrategy $mergeStrategy=null)
 Set the default for the configuration $key to $defaultValue. More...
 

Private Member Functions

 getVarName (string $key)
 

Private Attributes

string $prefix
 

Detailed Description

Definition at line 8 of file GlobalConfigBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Settings\Config\GlobalConfigBuilder::__construct ( string  $prefix = self::DEFAULT_PREFIX)
Parameters
string$prefix

Definition at line 20 of file GlobalConfigBuilder.php.

References MediaWiki\Settings\Config\GlobalConfigBuilder\$prefix.

Member Function Documentation

◆ build()

MediaWiki\Settings\Config\GlobalConfigBuilder::build ( )

Build the resulting Config object.

Returns
Config

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 47 of file GlobalConfigBuilder.php.

◆ getVarName()

MediaWiki\Settings\Config\GlobalConfigBuilder::getVarName ( string  $key)
private

◆ set()

MediaWiki\Settings\Config\GlobalConfigBuilder::set ( string  $key,
  $value,
MergeStrategy  $mergeStrategy = null 
)

Set the configuration $key to $value.

Parameters
string$key
mixed$value
MergeStrategy | null$mergeStrategystrategy for merging array config values.
Returns
ConfigBuilder
Exceptions
SettingsBuilderExceptionif a $mergeStrategy is not provided and the $value is not an array.

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 24 of file GlobalConfigBuilder.php.

References MediaWiki\Settings\Config\GlobalConfigBuilder\getVarName().

◆ setDefault()

MediaWiki\Settings\Config\GlobalConfigBuilder::setDefault ( string  $key,
  $defaultValue,
MergeStrategy  $mergeStrategy = null 
)

Set the default for the configuration $key to $defaultValue.

If the $key is already set, non-array $defaultValue will be ignored, for array $defaultValue the existing value will be merged into it as if the default was already there when the existing value was set.

Parameters
string$key
mixed$defaultValue
MergeStrategy | null$mergeStrategystrategy for merging array config values.
Returns
ConfigBuilder
Exceptions
SettingsBuilderExceptionif a $mergeStrategy is not provided and the $value is not an array.

Implements MediaWiki\Settings\Config\ConfigBuilder.

Definition at line 32 of file GlobalConfigBuilder.php.

References MediaWiki\Settings\Config\GlobalConfigBuilder\getVarName().

Member Data Documentation

◆ $prefix

string MediaWiki\Settings\Config\GlobalConfigBuilder::$prefix
private
Initial value:
=
public const DEFAULT_PREFIX 'wg'

Definition at line 15 of file GlobalConfigBuilder.php.

Referenced by MediaWiki\Settings\Config\GlobalConfigBuilder\__construct().


The documentation for this class was generated from the following file: