yakeing / php_saekv
Timitate sina cloud SaeKV class
Fund package maintenance!
yakeing
github.com/yakeing/Documentation/blob/main/Sponsor/README.md
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: 5.7
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