setArguments() public method

public setArguments ( array $arguments )
$arguments array
示例#1
0
文件: WATCH.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (isset($arguments[0]) && is_array($arguments[0])) {
         $arguments = $arguments[0];
     }
     parent::setArguments($arguments);
 }
示例#2
0
文件: SDIFFSTORE.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 2 && is_array($arguments[1])) {
         $arguments = array_merge(array($arguments[0]), $arguments[1]);
     }
     parent::setArguments($arguments);
 }
示例#3
0
文件: SLAVEOF.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 0 || $arguments[0] === 'NO ONE') {
         $arguments = array('NO', 'ONE');
     }
     parent::setArguments($arguments);
 }
示例#4
0
文件: GEORADIUS.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if ($arguments && is_array(end($arguments))) {
         $options = array_change_key_case(array_pop($arguments), CASE_UPPER);
         if (isset($options['WITHCOORD']) && $options['WITHCOORD'] == true) {
             $arguments[] = 'WITHCOORD';
         }
         if (isset($options['WITHDIST']) && $options['WITHDIST'] == true) {
             $arguments[] = 'WITHDIST';
         }
         if (isset($options['WITHHASH']) && $options['WITHHASH'] == true) {
             $arguments[] = 'WITHHASH';
         }
         if (isset($options['COUNT'])) {
             $arguments[] = 'COUNT';
             $arguments[] = $options['COUNT'];
         }
         if (isset($options['SORT'])) {
             $arguments[] = strtoupper($options['SORT']);
         }
         if (isset($options['STORE'])) {
             $arguments[] = 'STORE';
             $arguments[] = $options['STORE'];
         }
         if (isset($options['STOREDIST'])) {
             $arguments[] = 'STOREDIST';
             $arguments[] = $options['STOREDIST'];
         }
     }
     parent::setArguments($arguments);
 }
示例#5
0
文件: HSCAN.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 3 && is_array($arguments[2])) {
         $options = $this->prepareOptions(array_pop($arguments));
         $arguments = array_merge($arguments, $options);
     }
     parent::setArguments($arguments);
 }
示例#6
0
文件: GEOPOS.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 2 && is_array($arguments[1])) {
         $members = array_pop($arguments);
         $arguments = array_merge($arguments, $members);
     }
     parent::setArguments($arguments);
 }
示例#7
0
文件: BLPOP.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 2 && is_array($arguments[0])) {
         list($arguments, $timeout) = $arguments;
         array_push($arguments, $timeout);
     }
     parent::setArguments($arguments);
 }
示例#8
0
文件: BITOP.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 3 && is_array($arguments[2])) {
         list($operation, $destination) = $arguments;
         $arguments = $arguments[2];
         array_unshift($arguments, $operation, $destination);
     }
     parent::setArguments($arguments);
 }
示例#9
0
文件: GEOADD.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 2 && is_array($arguments[1])) {
         foreach (array_pop($arguments) as $item) {
             $arguments = array_merge($arguments, $item);
         }
     }
     parent::setArguments($arguments);
 }
示例#10
0
文件: ZADD.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (is_array(end($arguments))) {
         foreach (array_pop($arguments) as $member => $score) {
             $arguments[] = $score;
             $arguments[] = $member;
         }
     }
     parent::setArguments($arguments);
 }
示例#11
0
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     $options = array();
     $argc = count($arguments);
     if ($argc > 2 && is_array($arguments[$argc - 1])) {
         $options = $this->prepareOptions(array_pop($arguments));
     }
     if (is_array($arguments[1])) {
         $arguments = array_merge(array($arguments[0], count($arguments[1])), $arguments[1]);
     }
     parent::setArguments(array_merge($arguments, $options));
 }
示例#12
0
文件: HMSET.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 2 && is_array($arguments[1])) {
         $flattenedKVs = array($arguments[0]);
         $args = $arguments[1];
         foreach ($args as $k => $v) {
             $flattenedKVs[] = $k;
             $flattenedKVs[] = $v;
         }
         $arguments = $flattenedKVs;
     }
     parent::setArguments($arguments);
 }
示例#13
0
文件: MIGRATE.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (is_array(end($arguments))) {
         foreach (array_pop($arguments) as $modifier => $value) {
             $modifier = strtoupper($modifier);
             if ($modifier === 'COPY' && $value == true) {
                 $arguments[] = $modifier;
             }
             if ($modifier === 'REPLACE' && $value == true) {
                 $arguments[] = $modifier;
             }
         }
     }
     parent::setArguments($arguments);
 }
示例#14
0
文件: ZRANGE.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 4) {
         $lastType = gettype($arguments[3]);
         if ($lastType === 'string' && strtoupper($arguments[3]) === 'WITHSCORES') {
             // Used for compatibility with older versions
             $arguments[3] = array('WITHSCORES' => true);
             $lastType = 'array';
         }
         if ($lastType === 'array') {
             $options = $this->prepareOptions(array_pop($arguments));
             $arguments = array_merge($arguments, $options);
         }
     }
     parent::setArguments($arguments);
 }
示例#15
0
文件: SORT.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     if (count($arguments) === 1) {
         parent::setArguments($arguments);
         return;
     }
     $query = array($arguments[0]);
     $sortParams = array_change_key_case($arguments[1], CASE_UPPER);
     if (isset($sortParams['BY'])) {
         $query[] = 'BY';
         $query[] = $sortParams['BY'];
     }
     if (isset($sortParams['GET'])) {
         $getargs = $sortParams['GET'];
         if (is_array($getargs)) {
             foreach ($getargs as $getarg) {
                 $query[] = 'GET';
                 $query[] = $getarg;
             }
         } else {
             $query[] = 'GET';
             $query[] = $getargs;
         }
     }
     if (isset($sortParams['LIMIT']) && is_array($sortParams['LIMIT']) && count($sortParams['LIMIT']) == 2) {
         $query[] = 'LIMIT';
         $query[] = $sortParams['LIMIT'][0];
         $query[] = $sortParams['LIMIT'][1];
     }
     if (isset($sortParams['SORT'])) {
         $query[] = strtoupper($sortParams['SORT']);
     }
     if (isset($sortParams['ALPHA']) && $sortParams['ALPHA'] == true) {
         $query[] = 'ALPHA';
     }
     if (isset($sortParams['STORE'])) {
         $query[] = 'STORE';
         $query[] = $sortParams['STORE'];
     }
     parent::setArguments($query);
 }
示例#16
0
文件: SADD.php 项目: nrk/predis
 /**
  * {@inheritdoc}
  */
 public function setArguments(array $arguments)
 {
     $arguments = self::normalizeVariadic($arguments);
     parent::setArguments($arguments);
 }