當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Client::getProfile方法代碼示例

本文整理匯總了PHP中Predis\Client::getProfile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Client::getProfile方法的具體用法?PHP Client::getProfile怎麽用?PHP Client::getProfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Predis\Client的用法示例。


在下文中一共展示了Client::getProfile方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isPubSubSupported

 /**
  * Checks if the driver supports publish/subscribe pattern.
  *
  * @return bool
  */
 public function isPubSubSupported()
 {
     if ((double) $this->client->getProfile()->getVersion() >= 2.8) {
         return true;
     }
     return false;
 }
開發者ID:bravo3,項目名稱:orm,代碼行數:12,代碼來源:RedisDriver.php

示例2: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a Publish / Subscribe context.
  *
  * @param Client Client instance used by the context.
  */
 private function checkCapabilities(Client $client)
 {
     if (Helpers::isCluster($client->getConnection())) {
         throw new NotSupportedException('Cannot initialize a PUB/SUB context over a cluster of connections');
     }
     $commands = array('publish', 'subscribe', 'unsubscribe', 'psubscribe', 'punsubscribe');
     if ($client->getProfile()->supportsCommands($commands) === false) {
         throw new NotSupportedException('The current profile does not support PUB/SUB related commands');
     }
 }
開發者ID:kailIII,項目名稱:pos-erp,代碼行數:16,代碼來源:PubSubContext.php

示例3: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a transaction context.
  *
  * @param Client Client instance used by the context.
  */
 private function checkCapabilities(Client $client)
 {
     if (Helpers::isCluster($client->getConnection())) {
         throw new NotSupportedException('Cannot initialize a MULTI/EXEC context over a cluster of connections');
     }
     $profile = $client->getProfile();
     if ($profile->supportsCommands(array('multi', 'exec', 'discard')) === false) {
         throw new NotSupportedException('The current profile does not support MULTI, EXEC and DISCARD');
     }
     $this->canWatch = $profile->supportsCommands(array('watch', 'unwatch'));
 }
開發者ID:kailIII,項目名稱:pos-erp,代碼行數:17,代碼來源:MultiExecContext.php

示例4: testConstructorWithNullAndArrayArgument

 /**
  * @group disconnected
  */
 public function testConstructorWithNullAndArrayArgument()
 {
     $factory = $this->getMock('Predis\\Connection\\ConnectionFactoryInterface');
     $arg2 = array('profile' => '2.0', 'prefix' => 'prefix:', 'connections' => $factory);
     $client = new Client(null, $arg2);
     $profile = $client->getProfile();
     $this->assertSame($profile->getVersion(), ServerProfile::get('2.0')->getVersion());
     $this->assertInstanceOf('Predis\\Command\\Processor\\KeyPrefixProcessor', $profile->getProcessor());
     $this->assertSame('prefix:', $profile->getProcessor()->getPrefix());
     $this->assertSame($factory, $client->getConnectionFactory());
 }
開發者ID:rodrigopbel,項目名稱:ong,代碼行數:14,代碼來源:ClientTest.php

示例5: setRedis

 /**
  * Sets the redis instance to use.
  *
  * @param \Predis\Client $redis
  */
 public function setRedis(\Predis\Client $redis)
 {
     $this->_redis = $redis;
     $this->_supportsSetExpire = $redis->getProfile()->supportsCommand('setex');
 }
開發者ID:realestateconz,項目名稱:SncRedisBundle,代碼行數:10,代碼來源:RedisCache.php

示例6: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a monitor context.
  *
  * @param Client Client instance used by the context.
  */
 private function checkCapabilities(Client $client)
 {
     if (Helpers::isCluster($client->getConnection())) {
         throw new ClientException('Cannot initialize a monitor context over a cluster of connections');
     }
     if ($client->getProfile()->supportsCommand('monitor') === false) {
         throw new ClientException('The current profile does not support the MONITOR command');
     }
 }
開發者ID:silky,項目名稱:littlesis,代碼行數:15,代碼來源:Predis.php


注:本文中的Predis\Client::getProfile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。