Beispiel #1
0
echo "stat, data_used: {$ret->data_used}\n";
$stat = new MemLinkStat();
$ret = $m->stat2($key, $stat);
if ($ret != MEMLINK_OK) {
    echo "stat2 error: {$ret}\n";
    exit(-1);
}
echo "visible: {$stat->visible} tagdel: {$stat->tagdel}\n";
$stat = new MemLinkStat();
$ret = $m->stat2($key, $stat);
if ($ret != MEMLINK_OK) {
    echo "stat2 error: {$ret}\n";
    exit(-1);
}
echo "visible: {$stat->visible} tagdel: {$stat->tagdel}\n";
$ret = $m->range_visible($key, "::", 0, 10);
if (is_null($ret)) {
    echo "range error!";
    exit(-1);
}
echo "range, count: {$ret->count}\n";
$item = $ret->root;
while ($item) {
    echo "value: {$item->value}\n";
    $item = $item->next;
}
for ($i = 0; $i < 10; $i++) {
    $val = sprintf("%012d", $i);
    $ret = $m->delete($key, $val, strlen($val));
    if ($ret != MEMLINK_OK) {
        echo "delete error! {$ret} \n";