From df2e9f4e71d3b32bfce862cb65aa240eb109bb95 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 24 Jul 2015 18:15:21 +0200 Subject: [PATCH] Fix prefix processor to handle variadic EXISTS (Redis >= 3.0.3). --- src/Command/Processor/KeyPrefixProcessor.php | 2 +- tests/Predis/Command/Processor/KeyPrefixProcessorTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Command/Processor/KeyPrefixProcessor.php b/src/Command/Processor/KeyPrefixProcessor.php index 1ad0bf82..0f371820 100644 --- a/src/Command/Processor/KeyPrefixProcessor.php +++ b/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', diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index 08711566..15c7dac1 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/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'), + ), ); } }