coolexp / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

PHP Client Redis::_numeric_response doesn't handle numeric format correctly #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run test.php included with PHP Redis class

What is the expected output? What do you see instead?
When running LLEN a0 the expected output is 3, instead it's blank (NULL).

What version of the product are you using? On what operating system?
Version 0.1 currently available in trunk.

Please provide any additional information below.
Here is the fix I came up with:

redis.php: 
<snip>
    function &_numeric_response($allow_negative=True) {
        $s =& trim($this->_read());
        $s = (0 === strpos($s, ':')) ? substr($s, 1) : $s;
        $i = (int)$s;
</snip>

Original issue reported on code.google.com by jmcgr...@gmail.com on 22 May 2009 at 4:09

GoogleCodeExporter commented 8 years ago
There is also a problem with Redis::_get_value, looks like the PHP client was 
written
before the control character (either '$' or ':') was implemented for return 
counts.
Simply doing substr($s, 1) fixes the problem.

Original comment by jmcgr...@gmail.com on 22 May 2009 at 4:25

GoogleCodeExporter commented 8 years ago
Hello, you need to use Retwis 0.3 and the latest PHP client inside HEAD. What 
version
of Redis / Retwis / PHP lib are you using exactly? Thank you very much.

p.s. The PHP lib in Redis 0.096 should be ok as well.

Original comment by anti...@gmail.com on 22 May 2009 at 9:33

GoogleCodeExporter commented 8 years ago
Version located here:

http://code.google.com/p/redis/source/browse/#svn/trunk/client-libraries/php

Original comment by jmcgr...@gmail.com on 22 May 2009 at 3:45

GoogleCodeExporter commented 8 years ago
Hello, the SVN repository is not maintained, the updated source code is in the 
Git
repository, check the "Source" tab of the project page.

Cheers,
Salvatore

Original comment by anti...@gmail.com on 22 May 2009 at 4:46