Do not parse response to EXISTS into boolean value.

Starting with Redis 3.0.3 the EXISTS command is variadic so that it is
possible to check for the existence of multiple keys in one request,
with the server returning the number of keys found.

This change could break codebases relying on strict comparison (===)
against a boolean value, but just doing $redis->exists('key') == TRUE
is totally fine.
This commit is contained in:
Daniele Alessandri
2015-07-24 14:59:23 +02:00
parent 2eaf3d8595
commit ab20c52115
22 changed files with 80 additions and 50 deletions
@@ -63,7 +63,7 @@ class StringPreciseSetExpireTest extends PredisCommandTestCase
$redis = $this->getClient();
$this->assertEquals('OK', $redis->psetex('foo', 10000, 'bar'));
$this->assertTrue($redis->exists('foo'));
$this->assertSame(1, $redis->exists('foo'));
$this->assertEquals(10, $redis->ttl('foo'));
}
@@ -77,7 +77,7 @@ class StringPreciseSetExpireTest extends PredisCommandTestCase
$redis->psetex('foo', 50, 'bar');
$this->sleep(0.5);
$this->assertFalse($redis->exists('foo'));;
$this->assertSame(0, $redis->exists('foo'));;
}
/**