setRawArguments() public method

Sets the raw arguments for the command without processing them.
public setRawArguments ( array $arguments )
$arguments array List of arguments.
コード例 #1
0
ファイル: predis.php プロジェクト: vagus10cn/wordpress_4_1_1
 /**
  * Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE.
  *
  * @param CommandInterface $command Command instance.
  * @param string           $prefix  Prefix string.
  */
 public static function zsetStore(CommandInterface $command, $prefix)
 {
     if ($arguments = $command->getArguments()) {
         $arguments[0] = "{$prefix}{$arguments[0]}";
         $length = (int) $arguments[1] + 2;
         for ($i = 2; $i < $length; $i++) {
             $arguments[$i] = "{$prefix}{$arguments[$i]}";
         }
         $command->setRawArguments($arguments);
     }
 }
コード例 #2
0
ファイル: predis.php プロジェクト: sohel4r/wordpress_4_1_1
 /**
  * Applies the specified prefix to the key of a MIGRATE command.
  *
  * @param CommandInterface $command Command instance.
  * @param string           $prefix  Prefix string.
  */
 public static function migrate(CommandInterface $command, $prefix)
 {
     if ($arguments = $command->getArguments()) {
         $arguments[2] = "{$prefix}{$arguments[2]}";
         $command->setRawArguments($arguments);
     }
 }
コード例 #3
0
 /**
  * Applies the specified prefix to the key of a GEORADIUS command.
  *
  * @param CommandInterface $command Command instance.
  * @param string           $prefix  Prefix string.
  */
 public static function georadius(CommandInterface $command, $prefix)
 {
     if ($arguments = $command->getArguments()) {
         $arguments[0] = "{$prefix}{$arguments[0]}";
         $startIndex = $command->getId() === 'GEORADIUS' ? 5 : 4;
         if (($count = count($arguments)) > $startIndex) {
             for ($i = $startIndex; $i < $count; ++$i) {
                 switch (strtoupper($arguments[$i])) {
                     case 'STORE':
                     case 'STOREDIST':
                         $arguments[$i] = "{$prefix}{$arguments[++$i]}";
                         break;
                 }
             }
         }
         $command->setRawArguments($arguments);
     }
 }