A PHP Memcache client with binary protocol and SASL support.
You can find documentation on the PHP Memcached class here.
PHP Memcache class with SASL support, heroku test ok
License: BSD 3-Clause "New" or "Revised" License
A PHP Memcache client with binary protocol and SASL support.
You can find documentation on the PHP Memcached class here.
Increment and decrement don't appear to be functioning correctly. I did the following
$m->set('testkey',0);
var_dump($m->get('testkey'));
var_dump($m->increment('testkey'));
var_dump($m->get('testkey'));
which output
int(0)
bool(true)
int(2147483647)
2147483647 is 0x7FFFFFFF
I was expecting the value returned to be 1.
please close it in destruct
public function getStats($type=null){
$this->_send(array(
'opcode' => 0x10,
'key'=>$type
));
$ret = array();
$item = $this->_recv();
while ( !empty($item['key']) ){
$ret[$item['key']] = $item['body'];
$item = $this->_recv();
}
return $ret;
}
Without any license, nobody can properly use this class in their own projects. Please add at least a license header or even better a LICENSE file.
Hello,
I have a problem when I try to use setSaveHandler() to use Memcache as sessions handler
Here is the code
require 'MemcacheSASL.php';
$m = new MemcacheSASL;
$m->addServer('host', 11211);
$m->setSaslAuthData('user', 'password');
$m->setSaveHandler();
session_start();
$_SESSION['test'] = 'test1';
echo $_SESSION['test'];
It's doesn't print 'test1' as expected and there is an error in the log file
Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.8 with Suhosin-Patch configured
PHP Fatal error: Using $this when not in object context in MemcacheSASL.php on line 450
Could you please help check and fix this?
The following function implicitly constrains the data type of cache keys and values to String. Memcache and the binary SASL protocol support both keys and values of arbitrary type since they are binary formats. The client library should not assume that these items are strings.
protected function _build_request($data)
{
$valuelength = $extralength = $keylength = 0;
if (array_key_exists('extra', $data)) {
$extralength = strlen($data['extra']);
}
if (array_key_exists('key', $data)) {
$keylength = strlen($data['key']);
}
if (array_key_exists('value', $data)) {
$valuelength = strlen($data['value']);
}
...
...
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.