Quellcode durchsuchen

Fix prefix processor to handle variadic EXISTS (Redis >= 3.0.3).

Daniele Alessandri vor 9 Jahren
Ursprung
Commit
df2e9f4e71

+ 1 - 1
src/Command/Processor/KeyPrefixProcessor.php

@@ -34,7 +34,7 @@ class KeyPrefixProcessor implements ProcessorInterface
         $this->prefix = $prefix;
         $this->commands = array(
             /* ---------------- Redis 1.2 ---------------- */
-            'EXISTS' => 'self::first',
+            'EXISTS' => 'self::all',
             'DEL' => 'self::all',
             'TYPE' => 'self::first',
             'KEYS' => 'self::first',

+ 4 - 0
tests/Predis/Command/Processor/KeyPrefixProcessorTest.php

@@ -864,6 +864,10 @@ class KeyPrefixProcessorTest extends PredisTestCase
                 array('127.0.0.1', '6379', 'key', '0', '10', 'COPY', 'REPLACE'),
                 array('127.0.0.1', '6379', 'prefix:key', '0', '10', 'COPY', 'REPLACE'),
             ),
+            array('EXISTS',
+                array('key1', 'key2', 'key3'),
+                array('prefix:key1', 'prefix:key2', 'prefix:key3'),
+            ),
         );
     }
 }