MediaWiki master
|
Settings loaded from an etcd server. More...
Inherits Stringable, and MediaWiki\Settings\Cache\CacheableSource.
Public Member Functions | |
__construct (array $params=[], ?callable $mapper=null, ?Client $client=null, ?callable $resolver=null) | |
Constructs a new EtcdSource for the given etcd server details. | |
__toString () | |
Returns this etcd source as a string. | |
allowsStaleLoad () | |
Allow stale results from etcd sources in case all servers become temporarily unavailable. | |
getExpiryTtl () | |
The cache expiry TTL (in seconds) for this source. | |
getExpiryWeight () | |
Coefficient used in determining early expiration of cached settings to avoid stampedes. | |
getHashKey () | |
Returns a naive hash key for use in caching based on an etcd request URL constructed using the etcd request URL. | |
load () | |
Loads and returns settings from the etcd server. | |
MediaWiki\Settings\Source\EtcdSource::__construct | ( | array | $params = [], |
?callable | $mapper = null, | ||
?Client | $client = null, | ||
?callable | $resolver = null ) |
Constructs a new EtcdSource for the given etcd server details.
array | $params | Parameter map:
|
?callable | $mapper | Function that maps etcd entries to valid MediaWiki config/schema/php-ini values. Defaults to simply returning the structure stored in etcd. Signature: function ( array $settings ): array |
?Client | $client | Guzzle HTTP client used to query etcd. |
?callable | $resolver | Function that must return an array of server hostname/port pairs to try. The default resolver will either:
|
SettingsBuilderException | if the given host is invalid. |
Definition at line 90 of file EtcdSource.php.
References $params.
MediaWiki\Settings\Source\EtcdSource::__toString | ( | ) |
MediaWiki\Settings\Source\EtcdSource::allowsStaleLoad | ( | ) |
Allow stale results from etcd sources in case all servers become temporarily unavailable.
Implements MediaWiki\Settings\Cache\CacheableSource.
Definition at line 150 of file EtcdSource.php.
MediaWiki\Settings\Source\EtcdSource::getExpiryTtl | ( | ) |
The cache expiry TTL (in seconds) for this source.
Implements MediaWiki\Settings\Cache\CacheableSource.
Definition at line 185 of file EtcdSource.php.
MediaWiki\Settings\Source\EtcdSource::getExpiryWeight | ( | ) |
Coefficient used in determining early expiration of cached settings to avoid stampedes.
Implements MediaWiki\Settings\Cache\CacheableSource.
Definition at line 195 of file EtcdSource.php.
MediaWiki\Settings\Source\EtcdSource::getHashKey | ( | ) |
Returns a naive hash key for use in caching based on an etcd request URL constructed using the etcd request URL.
In the case where SRV discovery is performed, the host in the URL will be the SRV record name.
Implements MediaWiki\Settings\Cache\CacheableSource.
Definition at line 207 of file EtcdSource.php.
MediaWiki\Settings\Source\EtcdSource::load | ( | ) |
Loads and returns settings from the etcd server.
SettingsBuilderException |
Implements MediaWiki\Settings\Source\SettingsSource.
Definition at line 160 of file EtcdSource.php.