Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
GoogleCodeExporter opened this issue Feb 13, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant