当前位置: 首页>>代码示例>>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;未经允许,请勿转载。