本文整理汇总了PHP中Predis\ClientInterface::getOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP ClientInterface::getOptions方法的具体用法?PHP ClientInterface::getOptions怎么用?PHP ClientInterface::getOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predis\ClientInterface
的用法示例。
在下文中一共展示了ClientInterface::getOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteGlob
private function deleteGlob($pattern)
{
$keys = $this->client->keys($pattern);
$options = $this->client->getOptions();
if (isset($options->prefix)) {
$length = strlen($options->prefix->getPrefix());
$keys = array_map(function ($key) use($length) {
return substr($key, $length);
}, $keys);
}
if (count($keys) === 0) {
return;
}
$this->client->del($keys);
}
示例2: createExecutor
/**
* Returns a pipeline executor depending on the kind of the underlying
* connection and the passed options.
*
* @param ClientInterface $client Client instance used by the context.
* @return PipelineExecutorInterface
*/
protected function createExecutor(ClientInterface $client)
{
$options = $client->getOptions();
if (isset($options->exceptions)) {
return new StandardExecutor($options->exceptions);
}
return new StandardExecutor();
}
示例3: configure
/**
* Configures the transaction using the provided options.
*
* @param ClientInterface $client Underlying client instance.
* @param array $options Array of options for the transaction.
* */
protected function configure(ClientInterface $client, array $options)
{
if (isset($options['exceptions'])) {
$this->exceptions = (bool) $options['exceptions'];
} else {
$this->exceptions = $client->getOptions()->exceptions;
}
if (isset($options['cas'])) {
$this->modeCAS = (bool) $options['cas'];
}
if (isset($options['watch']) && ($keys = $options['watch'])) {
$this->watchKeys = $keys;
}
if (isset($options['retry'])) {
$this->attempts = (int) $options['retry'];
}
}