Skip to content

Commit 99a8dc6

Browse files
authored
Merge pull request #55 from cheprasov/v170
Added support for Redis-4.0.0
2 parents 916d778 + 129036e commit 99a8dc6

File tree

9 files changed

+49
-11
lines changed

9 files changed

+49
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## CHANGELOG
22

3+
### v1.7.0 (2017-07-22)
4+
- The client was checked with Redis-4.0.0
5+
- The client uses last stable redis version (Redis-4.0.0) by default.
6+
- Deprecated client's methods: **executeRawString**, **parseRawString**
7+
38
### v1.6.1 (2017-02-04)
49
- Added check for empty data on reading response.
510
- Fixed some tests.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
22
[![Latest Stable Version](https://poser.pugx.org/cheprasov/php-redis-client/v/stable)](https://packagist.org/packages/cheprasov/php-redis-client)
33
[![Total Downloads](https://poser.pugx.org/cheprasov/php-redis-client/downloads)](https://packagist.org/packages/cheprasov/php-redis-client)
4-
# RedisClient v1.6.1 for PHP >= 5.5
4+
# RedisClient v1.7.0 for PHP >= 5.5
55

66
## About
77
RedisClient is a fast, fully-functional and user-friendly client for Redis, optimized for performance. RedisClient supports the latest versions of Redis starting from __2.6__ to __4.0__
@@ -16,8 +16,8 @@ RedisClient is a fast, fully-functional and user-friendly client for Redis, opti
1616
- Connections to Redis are established lazily by the client upon the first command.
1717
- Easy to use with IDE, client has PHPDocs for all supported versions.
1818
- By default, the client works with the latest stable version of Redis (3.2).
19-
- Client was tested on the next versions of Redis: 2.6.17, 2.8.24, 3.0.7, 3.2.8, 4.0 RC2 (and other).
20-
- Also, Client was tested on PHP 5.5, 5.6, 7.0, 7.1, HHVM.
19+
- The client was tested on the next latest versions of Redis: 2.6.17, 2.8.24, 3.0.7, 3.2.8, 4.0.0.
20+
- Also, the client was tested on PHP 5.5, 5.6, 7.0, 7.1, HHVM.
2121

2222
## Usage
2323

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cheprasov/php-redis-client",
3-
"version": "1.6.1",
3+
"version": "1.7.0",
44
"description": "Php client for Redis. It is a fast, fully-functional and user-friendly client for Redis, optimized for performance. RedisClient supports the latest versions of Redis starting from 2.6 to 4.0",
55
"homepage": "http://github.com/cheprasov/php-redis-client",
66
"minimum-stability": "stable",

examples/raw_commands.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$Redis->executeRaw(['SET', 'foo', 'bar']);
3030
echo 'result: '. $Redis->executeRaw(['GET', 'foo']) .PHP_EOL; // bar
3131

32-
// Example 2. As string by <executeRawString>
32+
// DEPRECATED Example 2. As string by <executeRawString>
3333
// It is better to use executeRaw from example 1.
3434
$Redis->executeRawString('SET foo bar');
3535
echo 'result: '. $Redis->executeRawString('GET foo') .PHP_EOL; // bar

src/RedisClient/Client/AbstractRedisClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
abstract class AbstractRedisClient {
2828

29-
const VERSION = '1.6.1';
29+
const VERSION = '1.7.0';
3030

3131
const CONFIG_SERVER = 'server';
3232
const CONFIG_TIMEOUT = 'timeout';

src/RedisClient/ClientFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ClientFactory {
2525
const REDIS_VERSION_3x0 = '3.0';
2626
const REDIS_VERSION_3x2 = '3.2';
2727
const REDIS_VERSION_4x0 = '4.0';
28-
const REDIS_VERSION_DEFAULT = self::REDIS_VERSION_3x2;
28+
const REDIS_VERSION_DEFAULT = self::REDIS_VERSION_4x0;
2929

3030
/**
3131
* @var string|null

tests/Integration/RedisVersionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ class RedisVersionTest extends \PHPUnit_Framework_TestCase {
2727
[TEST_REDIS_SERVER_3x0_2, '3.0', '3.0.x'],
2828
[TEST_REDIS_SERVER_3x2_1, '3.2', '3.2.x'],
2929
[TEST_REDIS_SERVER_3x2_2, '3.2', '3.2.x'],
30-
// only for stable versions
31-
//[TEST_REDIS_SERVER_4x0_1, '4.0', '4.0.x'],
32-
//[TEST_REDIS_SERVER_4x0_2, '4.0', '4.0.x'],
30+
[TEST_REDIS_SERVER_4x0_1, '4.0', '4.0.x'],
31+
[TEST_REDIS_SERVER_4x0_2, '4.0', '4.0.x'],
3332
];
3433

3534
/**

tests/Integration/Version4x0/GeoCommandsTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,40 @@
1010
*/
1111
namespace Test\Integration\Version4x0;
1212

13+
use RedisClient\Exception\ErrorResponseException;
14+
1315
include_once(__DIR__ . '/../Version3x2/GeoCommandsTest.php');
1416

1517
class GeoCommandsTest extends \Test\Integration\Version3x2\GeoCommandsTest {
1618

19+
/**
20+
* @see \RedisClient\Command\Traits\Version3x2\GeoCommandsTrait::geohash
21+
*/
22+
public function test_geohash() {
23+
$Redis = static::$Redis;
24+
25+
$this->assertSame(2, $Redis->geoadd('Sicily', [
26+
'Palermo' => ['13.361389', '38.115556'],
27+
'Catania' => ['15.087269', '37.502669']
28+
]));
29+
30+
$this->assertSame(['sqc8b49rny0'], $Redis->geohash('Sicily', ['Palermo']));
31+
$this->assertSame(['sqc8b49rny0', 'sqdtr74hyu0'], $Redis->geohash('Sicily', ['Palermo', 'Catania']));
32+
$this->assertSame(['sqdtr74hyu0'], $Redis->geohash('Sicily', ['Catania']));
33+
$this->assertSame([null], $Redis->geohash('Sicily', ['foo']));
34+
$this->assertSame([null, 'sqc8b49rny0'], $Redis->geohash('Sicily', ['foo', 'Palermo']));
35+
$this->assertSame([null, 'sqc8b49rny0', null], $Redis->geohash('Sicily', ['foo', 'Palermo', 'bar']));
36+
$this->assertSame(['sqc8b49rny0', 'sqc8b49rny0'], $Redis->geohash('Sicily', ['Palermo', 'Palermo']));
37+
38+
$this->assertSame([null], $Redis->geohash('foo', ['a']));
39+
$this->assertSame([null, null, null], $Redis->geohash('foo', ['a', 'b', 'c']));
40+
41+
$this->assertSame(null, $Redis->geodist('Sicily', 'Catania', 'foo', 'ft'));
42+
$this->assertSame(null, $Redis->geodist('Sicily', 'bar', 'foo'));
43+
44+
$Redis->set('foo', 'bar');
45+
$this->setExpectedException(ErrorResponseException::class);
46+
$Redis->geodist('foo', 'bar', 'foo');
47+
}
48+
1749
}

tests/Integration/Version4x0/ServerCommandsTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function test_flushdb() {
4141
public function test_commandCount() {
4242
$Redis = static::$Redis;
4343

44-
$this->assertSame(178, $Redis->commandCount());
44+
$this->assertSame(180, $Redis->commandCount());
4545
}
4646

4747
/**
@@ -68,6 +68,8 @@ public function test_command() {
6868
'debug',
6969
'echo',
7070
'eval',
71+
'georadius_ro',
72+
'georadiusbymember_ro',
7173
'host:',
7274
'latency',
7375
'memory',

0 commit comments

Comments
 (0)