/**
  * @params include:
  *   - redisConfig  : An array of parameters to RedisConnectionPool::__construct().
  *   - redisServers : Array of server entries, the first being the primary and the
  *                    others being fallback servers. Each entry is either a hostname/port
  *                    combination or the absolute path of a UNIX socket.
  *                    If a hostname is specified but no port, the standard port number
  *                    6379 will be used. Required.
  * @param array $params
  */
 protected function __construct(array $params)
 {
     parent::__construct($params);
     $this->servers = isset($params['redisServers']) ? $params['redisServers'] : array($params['redisServer']);
     // b/c
     $this->redisPool = RedisConnectionPool::singleton($params['redisConfig']);
 }
 /**
  * @params include:
  *   - objectCache : Name of an object cache registered in $wgObjectCaches.
  *                   This defaults to the one specified by $wgMainCacheType.
  *   - cacheTTL    : Seconds to cache the aggregate data before regenerating.
  * @param array $params
  */
 protected function __construct(array $params)
 {
     parent::__construct($params);
     $this->cache = isset($params['objectCache']) ? wfGetCache($params['objectCache']) : wfGetMainCache();
     $this->cacheTTL = isset($params['cacheTTL']) ? $params['cacheTTL'] : 180;
     // 3 min
 }
 /**
  * @param array $params Possible keys:
  *   - redisConfig  : An array of parameters to RedisConnectionPool::__construct().
  *   - redisServers : Array of server entries, the first being the primary and the
  *                    others being fallback servers. Each entry is either a hostname/port
  *                    combination or the absolute path of a UNIX socket.
  *                    If a hostname is specified but no port, the standard port number
  *                    6379 will be used. Required.
  */
 public function __construct(array $params)
 {
     parent::__construct($params);
     $this->servers = isset($params['redisServers']) ? $params['redisServers'] : array($params['redisServer']);
     // b/c
     $params['redisConfig']['serializer'] = 'none';
     $this->redisPool = RedisConnectionPool::singleton($params['redisConfig']);
 }
Ejemplo n.º 4
0
 /**
  * @param array $params Possible keys:
  *   - redisConfig  : An array of parameters to RedisConnectionPool::__construct().
  *   - redisServers : Array of server entries, the first being the primary and the
  *                    others being fallback servers. Each entry is either a hostname/port
  *                    combination or the absolute path of a UNIX socket.
  *                    If a hostname is specified but no port, the standard port number
  *                    6379 will be used. Required.
  */
 public function __construct(array $params)
 {
     parent::__construct($params);
     $this->servers = isset($params['redisServers']) ? $params['redisServers'] : [$params['redisServer']];
     // b/c
     $params['redisConfig']['serializer'] = 'none';
     $this->redisPool = RedisConnectionPool::singleton($params['redisConfig']);
     $this->logger = \MediaWiki\Logger\LoggerFactory::getInstance('redis');
 }
 /**
  * @params include:
  *   - redisConfig : An array of parameters to RedisConnectionPool::__construct().
  *   - redisServer : A hostname/port combination or the absolute path of a UNIX socket.
  *                   If a hostname is specified but no port, the standard port number
  *                   6379 will be used. Required.
  * @param array $params
  */
 protected function __construct(array $params)
 {
     parent::__construct($params);
     $this->server = $params['redisServer'];
     $this->redisPool = RedisConnectionPool::singleton($params['redisConfig']);
 }