Skip to content

Commit 905aafb

Browse files
committed
v1.5.1
1 parent 46fab2b commit 905aafb

File tree

6 files changed

+25
-9
lines changed

6 files changed

+25
-9
lines changed

CHANGELOG.md

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

3+
### v1.5.1 (2016-08-17)
4+
- Fixed critical bug: https://github.com/cheprasov/php-redis-client/pull/45 Thanks to @BrianFranklin for help.
5+
36
### v1.5.0 (2016-08-15)
47
- Added command **TOUCH** for Redis >= 3.2.1
58

README.md

Lines changed: 2 additions & 2 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.5.0 for PHP >= 5.5
4+
# RedisClient v1.5.1 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 __3.2__
@@ -14,7 +14,7 @@ RedisClient is a fast, fully-functional and user-friendly client for Redis, opti
1414
- Support __RAW__ commands as strings `"SET foo bar"` or as arrays `['SET', 'foo', 'bar']`.
1515
- Connections to Redis are established lazily by the client upon the first command.
1616
- Easy to use with IDE, client has PHPDocs for all supported versions.
17-
- By default, the client works with the latest stable version of Redis (3.2.0).
17+
- By default, the client works with the latest stable version of Redis (3.2.3).
1818
- About **6.5-8.5% faster** than predis (based on this test: https://github.com/cheprasov/php-redis-client-vs-predis-test)
1919

2020
## Usage

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.5.0",
3+
"version": "1.5.1",
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 3.2",
55
"homepage": "http://github.com/cheprasov/php-redis-client",
66
"minimum-stability": "stable",

src/RedisClient/Client/AbstractRedisClient.php

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

2222
abstract class AbstractRedisClient {
2323

24-
const VERSION = '1.5.0';
24+
const VERSION = '1.5.1';
2525

2626
const CONFIG_SERVER = 'server';
2727
const CONFIG_TIMEOUT = 'timeout';

src/RedisClient/Connection/StreamConnection.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ public function readLine() {
8787
* @return string
8888
*/
8989
public function read($length) {
90-
$read = 0;
90+
$resource = $this->getResource();
91+
$left = $length;
9192
$data = '';
92-
while ($read != $length) {
93-
$data .= fread($this->getResource(), ($length - $read));
94-
$read = strlen($data);
95-
}
93+
do {
94+
$data .= fread($resource, min($left, 8192));
95+
$left = $length - strlen($data);
96+
} while ($left > 0);
97+
9698
return $data;
9799
}
98100

tests/Integration/Version2x6/CommonTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,15 @@ public function test_executeRaw() {
8484
$this->assertSame("String\r\nwith\r\nnewlines", $Redis->executeRaw(['GET', '']));
8585
}
8686

87+
public function test_bigData() {
88+
$Redis = static::$Redis;
89+
90+
$string = str_repeat(microtime(true), 1024 * 1024);
91+
$md5 = md5($string);
92+
93+
$this->assertSame(true, $Redis->set('foo', $string));
94+
$this->assertSame($string, $Redis->get('foo'));
95+
$this->assertSame($md5, md5($Redis->get('foo')));
96+
}
97+
8798
}

0 commit comments

Comments
 (0)