php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57945 can't get cas value
Submitted: 2007-12-02 22:21 UTC Modified: 2008-01-09 15:47 UTC
From: jjwang at tudou dot com Assigned:
Status: Not a bug Package: memcache (PECL)
PHP Version: 5.2.1 OS: CentOS 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jjwang at tudou dot com
New email:
PHP Version: OS:

 

 [2007-12-02 22:21 UTC] jjwang at tudou dot com
Description:
------------
The version of memcached is 1.2.4-rc2, I can't get flags and cas value using get() method of MemcachePool, and also the cas () method.
I know from the doc of memcached that, it supports two get command, get and gets, but I can only found one get() method in memcache-3.0.0. Does the two commands are the same?

Reproduce code:
---------------
$memcache = new MemcachePool();
$memcache->addServer('192.168.1.99', 11211, 11200);
$memcache->setFailureCallback('failureCallback');    

...

if (!($value = $memcache->get($key, $flags, $cas))) {
    echo "error: get, key-$key" . "<br />\n";
} else {
    echo "ok: get, key-$key value-$value flags-$flags cas-$cas" . "<br />\n";
}



Actual result:
--------------
ok: get, key-key_rbmyuysh value-value_czsjelml flags- cas-

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-09 15:47 UTC] mikael at synd dot info
Please read the API docs in the README, for example

 http://cvs.php.net/viewvc.cgi/pecl/memcache/README?revision=1.3.2.1&view=markup&pathrev=NON_BLOCKING_IO

Also, ensure that you have the latest versions of pecl/memcache (3.0.0) and memcached (1.2.4). The script below works fine for me

$m = new Memcache();
$m->connect('localhost');
$m->set('foo', 'bar', 16);

$flags = null;
$cas = null;
$m->get('foo', $var, $var2);
var_dump($flags);
var_dump($cas);

Outputs:
int(16)
int(2344)
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 15:03:28 2021 UTC