BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
EtcdConfig Class Reference
Inheritance diagram for EtcdConfig:
Collaboration diagram for EtcdConfig:

Public Member Functions

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

Protected Member Functions

 fetchAllFromEtcdServer ($address)
 
 parseResponse ($rbody)
 
 parseDirectory ($dirName, $dirNode, &$config)
 

Detailed Description

Interface for configuration instances

Since
1.29

Constructor & Destructor Documentation

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]

Member Function Documentation

EtcdConfig::fetchAllFromEtcd ( )
Returns
array (containing the keys config, error, retry, modifiedIndex)
EtcdConfig::fetchAllFromEtcdServer (   $address)
protected
Parameters
string$addressHost and port
Returns
array (containing the keys config, error, retry, modifiedIndex)
EtcdConfig::parseDirectory (   $dirName,
  $dirNode,
$config 
)
protected

Recursively parse a directory node and populate the array passed by reference, throwing EtcdConfigParseError if there is a validation error

Parameters
string$dirNameThe relative directory name
array$dirNodeThe decoded directory node
array&$configThe output array
Returns
int lastModifiedIndex The maximum last modified index across all keys in the directory
EtcdConfig::parseResponse (   $rbody)
protected

Parse a response body, throwing EtcdConfigParseError if there is a validation error

Parameters
string$rbody
Returns
array
EtcdConfig::setLogger ( LoggerInterface  $logger)

Sets a logger instance on the object.

Parameters
LoggerInterface$logger
Returns
void

Implements Psr\Log\LoggerAwareInterface.


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