yakeing/php_saekv

Timitate sina cloud SaeKV class

v6.1.0 2020-09-21 12:56 UTC

This package is auto-updated.

Last update: 2024-11-29 05:50:39 UTC


README

imitate sina cloud SaeKV class.

Travis CI

Travis-ci

codecov

codecov

Github badge

Downloads Size tag license languages

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.

Sponsor

Author

weibo: yakeing

twitter: yakeing