MediaWiki  master
HashConfig Class Reference

A Config instance which stores all settings as a member variable. More...

Inheritance diagram for HashConfig:
Collaboration diagram for HashConfig:

Public Member Functions

 __construct (array $settings=[])
 
 get ( $name)
 Get a configuration variable such as "Sitename" or "UploadMaintenance.".
Parameters
string$nameName of configuration option
Returns
mixed Value configured
Exceptions
ConfigException
More...
 
 getIterator ()
 Returns a traversable view of the configuration variables in this Config object.
Returns
Traversable<string,mixed>
More...
 
 getNames ()
 Returns the names of configuration variables in this Config object.
Returns
string[]
More...
 
 has ( $name)
 Check whether a configuration option is set for the given name.
Parameters
string$nameName of configuration option
Returns
bool
Since
1.24
More...
 
 set ( $name, $value)
 

Static Public Member Functions

static newInstance ()
 

Private Attributes

array $settings
 Array of config settings. More...
 

Detailed Description

A Config instance which stores all settings as a member variable.

Since
1.24

Definition at line 30 of file HashConfig.php.

Constructor & Destructor Documentation

◆ __construct()

HashConfig::__construct ( array  $settings = [])
Parameters
array$settingsAny current settings to pre-load

Definition at line 49 of file HashConfig.php.

References $settings.

Member Function Documentation

◆ get()

HashConfig::get (   $name)

Get a configuration variable such as "Sitename" or "UploadMaintenance.".

Parameters
string$nameName of configuration option
Returns
mixed Value configured
Exceptions
ConfigException

Implements Config.

Definition at line 56 of file HashConfig.php.

References has().

◆ getIterator()

HashConfig::getIterator ( )

Returns a traversable view of the configuration variables in this Config object.

Returns
Traversable<string,mixed>

Since
1.38
Returns
Traversable

Implements MediaWiki\Config\IterableConfig.

Definition at line 86 of file HashConfig.php.

◆ getNames()

HashConfig::getNames ( )

Returns the names of configuration variables in this Config object.

Returns
string[]

Since
1.38
Returns
string[]

Implements MediaWiki\Config\IterableConfig.

Definition at line 95 of file HashConfig.php.

◆ has()

HashConfig::has (   $name)

Check whether a configuration option is set for the given name.

Parameters
string$nameName of configuration option
Returns
bool
Since
1.24

Since
1.24

Implements Config.

Definition at line 68 of file HashConfig.php.

Referenced by get().

◆ newInstance()

static HashConfig::newInstance ( )
static
Returns
HashConfig

Definition at line 42 of file HashConfig.php.

◆ set()

HashConfig::set (   $name,
  $value 
)
See also
MutableConfig::set
Parameters
string$name
mixed$value

Implements MutableConfig.

Definition at line 77 of file HashConfig.php.

Member Data Documentation

◆ $settings

array HashConfig::$settings
private

Array of config settings.

Definition at line 37 of file HashConfig.php.

Referenced by __construct().


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