yakeing / php_saekv
This package is abandoned and no longer maintained.
No replacement package was suggested.
Timitate sina cloud SaeKV class
v6.1.0
2020-09-21 12:56 UTC
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: 5.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
imitate sina cloud SaeKV class.
Travis CI
codecov
Github badge
Installation
Use Composer to install the library. Of course, You can go to Packagist to view.
$ composer require yakeing/php_saekv
KV init
$kv = new SaeKV(3000); $ret = $kv->init("accesskey");
KV set data
$kv->set('kev','value');
KV add data
$kv->add('kev','value');
KV get data
$kv->get('kev');
KV delete data
$kv->delete('kev');
replace data
$ret = $kv->replace('abc', 'cccccc');
Get multiple groups of data
$keys = array(); array_push($keys, 'abc1'); array_push($keys, 'abc2'); array_push($keys, 'abc3'); $ret = $kv->mget($keys);
Get prefix range data
$ret = $kv->pkrget('abc', 3);
Get all data
$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);
}
get options list
$opts = $kv->get_options();
set options
$opts = array('encodekey' => 0); $ret = $kv->set_options($opts);
Local file
kvdb.txt (json)
{
kev1:value1,
kev2:[
kev2:value2,
kev3:value3
],.....
}
Original document
Documents: SaeKV-code
Sponsor
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.
Author
weibo: yakeing
twitter: yakeing