imitate sina cloud SaeKV class.
Use Composer to install the library. Of course, You can go to Packagist to view.
$ composer require yakeing/php_saekv
$kv = new SaeKV(3000);
$ret = $kv->init("accesskey");
$kv->set('kev','value');
$kv->add('kev','value');
$kv->get('kev');
$kv->delete('kev');
$ret = $kv->replace('abc', 'cccccc');
$keys = array();
array_push($keys, 'abc1');
array_push($keys, 'abc2');
array_push($keys, 'abc3');
$ret = $kv->mget($keys);
$ret = $kv->pkrget('abc', 3);
$ret = $kv->pkrget('');
Invalid
$ret = $kv->pkrget('', 100);
while(true){
var_dump($ret);
end($ret);
$start_key = key($ret);
$i = count($ret);
if ($i < 100) break;
$ret = $kv->pkrget('', 100, $start_key);
}
$opts = $kv->get_options();
$opts = array('encodekey' => 0);
$ret = $kv->set_options($opts);
kvdb.txt (json)
{
kev1:value1,
kev2:[
kev2:value2,
kev3:value3
],.....
}
Documents: SaeKV-code
If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate.
weibo: yakeing
twitter: yakeing