MediaWiki REL1_40
GlobalVarConfig Class Reference

Accesses configuration settings from $GLOBALS. More...

Inherits Config.

Collaboration diagram for GlobalVarConfig:

Public Member Functions

 __construct ( $prefix='wg')
 
 get ( $name)
 Get a configuration variable such as "Sitename" or "UploadMaintenance.".
Parameters
string$nameName of configuration option
Returns
mixed Value configured
Exceptions
ConfigException

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

 

Static Public Member Functions

static newInstance ()
 Default builder function.
 

Protected Member Functions

 getWithPrefix ( $prefix, $name)
 Get a variable with a given prefix, if not the defaults.
 
 hasWithPrefix ( $prefix, $name)
 Check if a variable with a given prefix is set.
 

Detailed Description

Accesses configuration settings from $GLOBALS.

Stability: newable
Since
1.23

Definition at line 29 of file GlobalVarConfig.php.

Constructor & Destructor Documentation

◆ __construct()

GlobalVarConfig::__construct ( $prefix = 'wg')
Stability: stable
to call
Parameters
string$prefix

Definition at line 50 of file GlobalVarConfig.php.

Member Function Documentation

◆ get()

GlobalVarConfig::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 57 of file GlobalVarConfig.php.

References getWithPrefix(), and has().

◆ getWithPrefix()

GlobalVarConfig::getWithPrefix ( $prefix,
$name )
protected

Get a variable with a given prefix, if not the defaults.

Parameters
string$prefixPrefix to use on the variable, if one.
string$nameVariable name without prefix
Returns
mixed

Definition at line 78 of file GlobalVarConfig.php.

Referenced by get().

◆ has()

GlobalVarConfig::has ( $name)

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

Parameters
string$nameName of configuration option
Returns
bool
Since
1.24

Implements Config.

Definition at line 67 of file GlobalVarConfig.php.

References hasWithPrefix().

Referenced by get().

◆ hasWithPrefix()

GlobalVarConfig::hasWithPrefix ( $prefix,
$name )
protected

Check if a variable with a given prefix is set.

Parameters
string$prefixPrefix to use on the variable
string$nameVariable name without prefix
Returns
bool

Definition at line 89 of file GlobalVarConfig.php.

Referenced by has().

◆ newInstance()

static GlobalVarConfig::newInstance ( )
static

Default builder function.

Returns
GlobalVarConfig

Definition at line 41 of file GlobalVarConfig.php.


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