当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::__construct方法代码示例

本文整理汇总了PHP中Predis\Client::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::__construct方法的具体用法?PHP Client::__construct怎么用?PHP Client::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Predis\Client的用法示例。


在下文中一共展示了Client::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 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);
 }
开发者ID:wwtg99,项目名称:flight2wwu,代码行数:13,代码来源:PRedis.php

示例2: unset

 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);
 }
开发者ID:ronnylt,项目名称:LtRedisBundle,代码行数:10,代码来源:RedisClient.php

示例3: __construct

 /**
  * @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);
 }
开发者ID:formula9,项目名称:framework,代码行数:17,代码来源:OpulencePredis.php

示例4: __construct

 /**
  * @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');
 }
开发者ID:gitter-badger,项目名称:php-rq,代码行数:23,代码来源:Client.php

示例5: __construct

 /**
  * @param null $parameters
  * @param null $options
  */
 public function __construct($parameters = null, $options = null)
 {
     unset($options['prefix']);
     parent::__construct($parameters, $options);
 }
开发者ID:akentner,项目名称:incoming-ftp,代码行数:9,代码来源:RedisNonPrefixed.php

示例6: __construct

 public function __construct($host = '127.0.0.1', $port = 6379)
 {
     parent::__construct(['scheme' => 'tcp', 'host' => $host, 'port' => $port]);
 }
开发者ID:azhai,项目名称:CuteLib,代码行数:4,代码来源:RedisPHP.php

示例7: __construct

 public function __construct($host, $password, $port)
 {
     parent::__construct(['scheme' => 'tcp', 'host' => $host, 'password' => $password, 'port' => $port]);
 }
开发者ID:dzoke,项目名称:CmsBundle,代码行数:4,代码来源:RedisClient.php

示例8: __construct

 /**
  * 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);
 }
开发者ID:RTLer,项目名称:php-resque-ex,代码行数:19,代码来源:RedisApi.php


注:本文中的Predis\Client::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。