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


PHP ClientInterface::getProfile方法代码示例

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


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

示例1: __construct

 /**
  * {@inheritdoc}
  */
 public function __construct(ClientInterface $client)
 {
     if (!$client->getProfile()->supportsCommands(array('multi', 'exec', 'discard'))) {
         throw new ClientException("The current profile does not support 'MULTI', 'EXEC' and 'DISCARD'.");
     }
     parent::__construct($client);
 }
开发者ID:flachesis,项目名称:predis,代码行数:10,代码来源:Atomic.php

示例2: assertClient

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize the transaction object.
  *
  * @param ClientInterface $client Client instance used by the transaction object.
  *
  * @throws NotSupportedException
  */
 private function assertClient(ClientInterface $client)
 {
     if ($client->getConnection() instanceof AggregateConnectionInterface) {
         throw new NotSupportedException('Cannot initialize a MULTI/EXEC transaction over aggregate connections.');
     }
     if (!$client->getProfile()->supportsCommands(array('MULTI', 'EXEC', 'DISCARD'))) {
         throw new NotSupportedException('The current profile does not support MULTI, EXEC and DISCARD.');
     }
 }
开发者ID:hexcode007,项目名称:yfcms,代码行数:17,代码来源:MultiExec.php

示例3: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a monitor context.
  *
  * @param ClientInterface $client Client instance used by the context.
  */
 private function checkCapabilities(ClientInterface $client)
 {
     if ($client->getConnection() instanceof AggregatedConnectionInterface) {
         throw new NotSupportedException('Cannot initialize a monitor context when using aggregated connections');
     }
     if ($client->getProfile()->supportsCommand('monitor') === false) {
         throw new NotSupportedException('The current profile does not support the MONITOR command');
     }
 }
开发者ID:kchhainarong,项目名称:chantuchP,代码行数:15,代码来源:MonitorContext.php

示例4: assertClient

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a monitor consumer.
  *
  * @param ClientInterface $client Client instance used by the consumer.
  *
  * @throws NotSupportedException
  */
 private function assertClient(ClientInterface $client)
 {
     if ($client->getConnection() instanceof AggregateConnectionInterface) {
         throw new NotSupportedException('Cannot initialize a monitor consumer over aggregate connections.');
     }
     if ($client->getProfile()->supportsCommand('MONITOR') === false) {
         throw new NotSupportedException("The current profile does not support 'MONITOR'.");
     }
 }
开发者ID:huycao,项目名称:yodelivery,代码行数:17,代码来源:Consumer.php

示例5: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a Publish / Subscribe context.
  *
  * @param ClientInterface $client Client instance used by the context.
  */
 private function checkCapabilities(ClientInterface $client)
 {
     if ($client->getConnection() instanceof AggregatedConnectionInterface) {
         throw new NotSupportedException('Cannot initialize a PUB/SUB context when using aggregated 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:GeorgeBroadley,项目名称:caffeine-vendor,代码行数:16,代码来源:PubSubContext.php

示例6: requiredCommand

 /**
  * Ensures that the client supports the specified Redis command required to
  * fetch elements from the server to perform the iteration.
  *
  * @param ClientInterface $client    Client connected to Redis.
  * @param string          $commandID Command ID.
  *
  * @throws NotSupportedException
  */
 protected function requiredCommand(ClientInterface $client, $commandID)
 {
     if (!$client->getProfile()->supportsCommand($commandID)) {
         throw new NotSupportedException("The current profile does not support '{$commandID}'.");
     }
 }
开发者ID:flachesis,项目名称:predis,代码行数:15,代码来源:CursorBasedIterator.php

示例7: checkCapabilities

 /**
  * Checks if the passed client instance satisfies the required conditions
  * needed to initialize a transaction context.
  *
  * @param ClientInterface $client Client instance used by the context.
  */
 private function checkCapabilities(ClientInterface $client)
 {
     if ($client->getConnection() instanceof AggregatedConnectionInterface) {
         throw new NotSupportedException('Cannot initialize a MULTI/EXEC context when using aggregated 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:biswars,项目名称:retwis,代码行数:17,代码来源:MultiExecContext.php

示例8: requiredCommand

 /**
  * Ensures that the client instance supports the specified Redis
  * command required to fetch elements from the server to perform
  * the iteration.
  *
  * @param ClientInterface $client    Client connected to Redis.
  * @param string          $commandID Command ID.
  */
 protected function requiredCommand(ClientInterface $client, $commandID)
 {
     if (!$client->getProfile()->supportsCommand($commandID)) {
         throw new NotSupportedException("The specified server profile does not support the `{$commandID}` command.");
     }
 }
开发者ID:rodrigopbel,项目名称:ong,代码行数:14,代码来源:ListKey.php


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