php-memcached-dev/php-memcached — pull request #6 by jhansche (2012-01-18 20:20:53+00:00)
Title: Fixes an incorrect libmemcached version check for OPT_PREFIX_KEY

The PREFIX_KEY functionality had a comment explaining that a bug
had to be worked around, in all version prior to 0.50. However,
that assumption was invalid, as the memcached_set_prefix_key()
behavior was only rewritten in version 0.49. Since the error was
fixed in libmemcached-0.50, that means it only exists in one version:
0.49.

I tested this fix against every release between 0.44 - 0.50, and
confirmed that the bug only has to be worked around in *exactly*
version 0.49.

The simple test:

[terminalA] $ nc -l localhost 5555

[terminalB] $ php -a
php > $mc = new Memcached();
php > $mc->addServer('localhost', 5555, 1);
php > $mc->setOption(Memcached::OPT_PREFIX_KEY, 'foo');
php > $mc->set('bar', 1, 15);

I saw "foo0bar" coming through in version 0.44 - 0.48. The problem
was fixed in 0.49 and 0.50.