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


PHP Client::select方法代码示例

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


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

示例1: list

 function __construct($url)
 {
     try {
         list($user, $passwd, $host, $port, $db) = self::parseRedisUrl($url);
         $this->_redis = new Client(array('host' => $host, 'port' => $port));
     } catch (\Exception $e) {
         throw new RedisBundleException($e);
     }
     try {
         $this->_redis->connect();
         $this->_redis->select($db);
     } catch (\Predis\Connection\ConnectionException $e) {
         throw new RedisBundleException($e);
     }
 }
开发者ID:haberberger,项目名称:redisstoragebundle,代码行数:15,代码来源:RedisStorage.php

示例2: getClient

 /**
  * Returns a new client instance.
  *
  * @return Client
  */
 protected function getClient()
 {
     $parameters = array('host' => REDIS_SERVER_HOST, 'port' => REDIS_SERVER_PORT, 'iterable_multibulk' => true, 'read_write_timeout' => 2);
     $client = new Client($parameters, REDIS_SERVER_VERSION);
     $client->connect();
     $client->select(REDIS_SERVER_DBNUM);
     $client->flushdb();
     return $client;
 }
开发者ID:keneanung,项目名称:gw2spidy,代码行数:14,代码来源:MultiBulkResponseTupleTest.php

示例3: setupFeature

 /** @BeforeFeature */
 public static function setupFeature(FeatureEvent $event)
 {
     try {
         $redis = new Client('tcp://127.0.0.1:6379');
         $redis->select(15);
         $redis->flushdb();
     } catch (\Exception $e) {
         echo "Redis Server is needed to test features!" . PHP_EOL;
         throw $e;
     }
 }
开发者ID:redtrine,项目名称:redtrine,代码行数:12,代码来源:FeatureContext.php

示例4: getClient

 /**
  * Returns a new client instance.
  *
  * @param Boolean $connect Flush selected database before returning the client.
  * @return Client
  */
 protected function getClient($flushdb = true)
 {
     $profile = $this->getProfile();
     if (!$profile->supportsCommand($id = $this->getExpectedId())) {
         $this->markTestSkipped("The profile {$profile->getVersion()} does not support command {$id}");
     }
     $parameters = array('host' => REDIS_SERVER_HOST, 'port' => REDIS_SERVER_PORT);
     $options = array('profile' => $profile);
     $client = new Client($parameters, $options);
     $client->connect();
     $client->select(REDIS_SERVER_DBNUM);
     if ($flushdb) {
         $client->flushdb();
     }
     return $client;
 }
开发者ID:surjit,项目名称:node-redis-php-chat-app,代码行数:22,代码来源:CommandTestCase.php

示例5: __construct

 public function __construct()
 {
     $this->redis = new Client(array('host' => self::$host, 'port' => self::$port, 'database' => self::$port));
     $this->redis->select(self::$db);
 }
开发者ID:PhanQuocTrung,项目名称:WeatherStation,代码行数:5,代码来源:Redis.php

示例6: createClient

 public function createClient()
 {
     $client = new Predis\Client();
     $client->select(10);
     return $client;
 }
开发者ID:gmo,项目名称:cache,代码行数:6,代码来源:PredisTest.php

示例7: select

 /**
  * @inheritdoc
  */
 public function select($database)
 {
     parent::select($database);
     $this->server->setDatabaseIndex($database);
 }
开发者ID:formula9,项目名称:framework,代码行数:8,代码来源:OpulencePredis.php

示例8: select

 public function select($database)
 {
     return $this->_client->select($database);
 }
开发者ID:Antevenio,项目名称:redis,代码行数:4,代码来源:Client.php


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