MediaWiki  1.29.2
EtcdConfig Class Reference

Interface for configuration instances. More...

Inheritance diagram for EtcdConfig:
Collaboration diagram for EtcdConfig:

Public Member Functions

 __construct (array $params)
 
 fetchAllFromEtcd ()
 
 get ( $name)
 
 has ( $name)
 
 setLogger (LoggerInterface $logger)
 

Protected Member Functions

 fetchAllFromEtcdServer ( $address)
 

Private Member Functions

 load ()
 
 unserialize ( $string)
 

Private Attributes

integer $baseCacheTTL
 
string $directory
 
string $directoryHash
 
string $encoding
 
string $host
 
MultiHttpClient $http
 
LoggerInterface $logger
 
array $procCache
 
string $protocol
 
integer $skewCacheTTL
 
BagOStuff $srvCache
 
integer $timeout
 

Detailed Description

Interface for configuration instances.

Since
1.29

Definition at line 33 of file EtcdConfig.php.

Constructor & Destructor Documentation

◆ __construct()

EtcdConfig::__construct ( array  $params)
Parameters
array$paramsParameter map:
  • host: the host address and port
  • protocol: either http or https
  • directory: the etc "directory" were MediaWiki specific variables are located
  • encoding: one of ("JSON", "YAML"). Defaults to JSON. [optional]
  • cache: BagOStuff instance or ObjectFactory spec thereof for a server cache. The cache will also be used as a fallback if etcd is down. [optional]
  • cacheTTL: logical cache TTL in seconds [optional]
  • skewTTL: maximum seconds to randomly lower the assigned TTL on cache save [optional]
  • timeout: seconds to wait for etcd before throwing an error [optional]

Definition at line 72 of file EtcdConfig.php.

References $params, directory, ObjectFactory\getObjectFromSpec(), and http.

Member Function Documentation

◆ fetchAllFromEtcd()

EtcdConfig::fetchAllFromEtcd ( )
Returns
array (config array or null, error string, allow retries)

Definition at line 196 of file EtcdConfig.php.

References $host, IP\combineHostAndPort(), fetchAllFromEtcdServer(), and list.

Referenced by load().

◆ fetchAllFromEtcdServer()

EtcdConfig::fetchAllFromEtcdServer (   $address)
protected
Parameters
string$addressHost and port
Returns
array (config array or null, error string, whether to allow retries)

Definition at line 224 of file EtcdConfig.php.

References $name, $value, as, false, http, list, true, and unserialize().

Referenced by fetchAllFromEtcd().

◆ get()

EtcdConfig::get (   $name)

Definition at line 115 of file EtcdConfig.php.

References $name, and load().

◆ has()

EtcdConfig::has (   $name)

Definition at line 109 of file EtcdConfig.php.

References $name, and load().

◆ load()

EtcdConfig::load ( )
private

Definition at line 125 of file EtcdConfig.php.

References $baseCacheTTL, $skewCacheTTL, $timeout, fetchAllFromEtcd(), list, IExpiringStore\TTL_INDEFINITE, and use.

Referenced by get(), and has().

◆ setLogger()

EtcdConfig::setLogger ( LoggerInterface  $logger)

Definition at line 105 of file EtcdConfig.php.

References $logger.

◆ unserialize()

EtcdConfig::unserialize (   $string)
private
Parameters
string$string
Returns
mixed

Definition at line 268 of file EtcdConfig.php.

Referenced by fetchAllFromEtcdServer().

Member Data Documentation

◆ $baseCacheTTL

integer EtcdConfig::$baseCacheTTL
private

Definition at line 52 of file EtcdConfig.php.

Referenced by load().

◆ $directory

string EtcdConfig::$directory
private

Definition at line 48 of file EtcdConfig.php.

◆ $directoryHash

string EtcdConfig::$directoryHash
private

Definition at line 58 of file EtcdConfig.php.

◆ $encoding

string EtcdConfig::$encoding
private

Definition at line 50 of file EtcdConfig.php.

◆ $host

string EtcdConfig::$host
private

Definition at line 44 of file EtcdConfig.php.

Referenced by fetchAllFromEtcd().

◆ $http

MultiHttpClient EtcdConfig::$http
private

Definition at line 35 of file EtcdConfig.php.

◆ $logger

LoggerInterface EtcdConfig::$logger
private

Definition at line 41 of file EtcdConfig.php.

Referenced by setLogger().

◆ $procCache

array EtcdConfig::$procCache
private

Definition at line 39 of file EtcdConfig.php.

◆ $protocol

string EtcdConfig::$protocol
private

Definition at line 46 of file EtcdConfig.php.

◆ $skewCacheTTL

integer EtcdConfig::$skewCacheTTL
private

Definition at line 54 of file EtcdConfig.php.

Referenced by load().

◆ $srvCache

BagOStuff EtcdConfig::$srvCache
private

Definition at line 37 of file EtcdConfig.php.

◆ $timeout

integer EtcdConfig::$timeout
private

Definition at line 56 of file EtcdConfig.php.

Referenced by load().


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