__construct() public method

public __construct ( mixed $parameters = null, mixed $options = null )
$parameters mixed Connection parameters for one or more servers.
$options mixed Options to configure some behaviours of the client.
コード例 #1
0
ファイル: PRedis.php プロジェクト: wwtg99/flight2wwu
 /**
  * PRedis constructor.
  *
  * @param array $conf
  * @param $options
  */
 public function __construct($conf = [], $options = null)
 {
     if (!$conf) {
         $conf = \Flight::get('config')->get('redis');
     }
     parent::__construct($conf, $options);
 }
コード例 #2
0
ファイル: RedisClient.php プロジェクト: ronnylt/LtRedisBundle
 function __construct($parameters = null, $options = null, ConnectionFactory $factory = null)
 {
     if (empty($parameters['password'])) {
         unset($parameters['password']);
     }
     if (!empty($factory)) {
         $options['connections'] = $factory;
     }
     parent::__construct($parameters, $options);
 }
コード例 #3
0
ファイル: OpulencePredis.php プロジェクト: formula9/framework
 /**
  * @param Server $server The server to use
  * @param TypeMapper $typeMapper The type mapper to use
  */
 public function __construct(Server $server, TypeMapper $typeMapper)
 {
     $this->server = $server;
     $this->typeMapper = $typeMapper;
     $connectionOptions = ["host" => $this->server->getHost(), "port" => $this->server->getPort(), "database" => $this->server->getDatabaseIndex()];
     if ($this->server->passwordIsSet()) {
         $connectionOptions["password"] = $this->server->getPassword();
     }
     if ($this->server->getConnectionTimeout() > 0) {
         $connectionOptions["connection_timeout"] = $this->server->getConnectionTimeout();
     }
     parent::__construct($connectionOptions);
 }
コード例 #4
0
ファイル: Client.php プロジェクト: gitter-badger/php-rq
 /**
  * @param mixed $parameters Connection parameters for one or more servers.
  * @param mixed $options    Options to configure some behaviours of the client.
  */
 public function __construct($parameters = null, $options = null)
 {
     parent::__construct($parameters, $options);
     /** @var \Predis\Profile\RedisProfile $profile */
     $profile = $this->getProfile();
     $profile->defineCommand('queueGet', 'PhpRQ\\Command\\Queue\\Get');
     $profile->defineCommand('queueAck', 'PhpRQ\\Command\\Queue\\Ack');
     $profile->defineCommand('queueReject', 'PhpRQ\\Command\\Queue\\Reject');
     $profile->defineCommand('queueReEnqueue', 'PhpRQ\\Command\\Queue\\ReEnqueue');
     $profile->defineCommand('uniqueQueueAdd', 'PhpRQ\\Command\\UniqueQueue\\Add');
     $profile->defineCommand('uniqueQueueGet', 'PhpRQ\\Command\\UniqueQueue\\Get');
     $profile->defineCommand('uniqueQueueAck', 'PhpRQ\\Command\\UniqueQueue\\Ack');
     $profile->defineCommand('uniqueQueueReject', 'PhpRQ\\Command\\UniqueQueue\\Reject');
     $profile->defineCommand('uniqueQueueReEnqueue', 'PhpRQ\\Command\\UniqueQueue\\ReEnqueue');
     $profile->defineCommand('poolGet', 'PhpRQ\\Command\\Pool\\Get');
     $profile->defineCommand('poolAck', 'PhpRQ\\Command\\Pool\\Ack');
     $profile->defineCommand('poolRemove', 'PhpRQ\\Command\\Pool\\Remove');
     $profile->defineCommand('wait', 'PhpRQ\\Command\\Wait');
 }
コード例 #5
0
 /**
  * @param null $parameters
  * @param null $options
  */
 public function __construct($parameters = null, $options = null)
 {
     unset($options['prefix']);
     parent::__construct($parameters, $options);
 }
コード例 #6
0
ファイル: RedisPHP.php プロジェクト: azhai/CuteLib
 public function __construct($host = '127.0.0.1', $port = 6379)
 {
     parent::__construct(['scheme' => 'tcp', 'host' => $host, 'port' => $port]);
 }
コード例 #7
0
ファイル: RedisClient.php プロジェクト: dzoke/CmsBundle
 public function __construct($host, $password, $port)
 {
     parent::__construct(['scheme' => 'tcp', 'host' => $host, 'password' => $password, 'port' => $port]);
 }
コード例 #8
0
ファイル: RedisApi.php プロジェクト: RTLer/php-resque-ex
 /**
  * RedisApi constructor.
  * set all options and add prefix processor to make prefix customizable
  *
  * @param array|string $host
  * @param integer $port
  * @param integer $timeout
  * @param null|string $password
  */
 public function __construct($host, $port = 6379, $timeout = 5, $password = null)
 {
     $options = ['port' => $port, 'database' => 0, 'timeout' => $timeout, 'password' => $password];
     if (is_array($host)) {
         $options['cluster'] = 'redis';
     }
     parent::__construct($host, $options);
     $this->prefix = new KeyPrefixProcessor(self::$namespace);
     $this->getProfile()->setProcessor($this->prefix);
 }