MediaWiki master
MediaWiki\Config\HashConfig Class Reference

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

Inherits MediaWiki\Config\Config, MediaWiki\Config\MutableConfig, and MediaWiki\Config\IterableConfig.

Collaboration diagram for MediaWiki\Config\HashConfig:

Public Member Functions

 __construct (array $settings=[])
 
 clear ()
 Clears all config variables.
 
 get ( $name)
 Get a configuration variable such as "Sitename" or "UploadMaintenance.".
Parameters
string$nameName of configuration option
Returns
mixed Value configured
Exceptions
ConfigException

 
 getIterator ()
 Returns a traversable view of the configuration variables in this Config object.
Returns
Traversable<string,mixed>

 
 getNames ()
 Returns the names of configuration variables in this Config object.
Returns
string[]

 
 has ( $name)
 Check whether a configuration option is set for the given name.
Parameters
string$nameName of configuration option
Returns
bool
Since
1.24

 
 set ( $name, $value)
 

Static Public Member Functions

static newInstance ()
 

Detailed Description

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

Since
1.24

Definition at line 33 of file HashConfig.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 52 of file HashConfig.php.

Member Function Documentation

◆ clear()

MediaWiki\Config\HashConfig::clear ( )

Clears all config variables.

Since
1.39

Definition at line 106 of file HashConfig.php.

◆ get()

MediaWiki\Config\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 MediaWiki\Config\Config.

Definition at line 59 of file HashConfig.php.

References MediaWiki\Config\HashConfig\has().

◆ getIterator()

MediaWiki\Config\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 89 of file HashConfig.php.

◆ getNames()

MediaWiki\Config\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 98 of file HashConfig.php.

◆ has()

MediaWiki\Config\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 MediaWiki\Config\Config.

Definition at line 71 of file HashConfig.php.

Referenced by MediaWiki\Config\HashConfig\get().

◆ newInstance()

static MediaWiki\Config\HashConfig::newInstance ( )
static
Returns
HashConfig

Definition at line 45 of file HashConfig.php.

◆ set()

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

Implements MediaWiki\Config\MutableConfig.

Definition at line 80 of file HashConfig.php.


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