getOptions() public method

Returns the client options specified upon initialization.
public getOptions ( ) : Predis\Configuration\OptionsInterface
return Predis\Configuration\OptionsInterface
示例#1
0
 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);
 }
 /**
  * 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
0
 /**
  * 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'];
     }
 }