Esempio n. 1
0
}
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";
        exit(0);
    }
}
$count = $m->count($key, '');
if ($count) {
    echo "count: {$count->visible_count} {$count->tagdel_count} \n";
}
$count = new MemLinkCount();
$ret = $m->count2($key, '', $count);
if ($ret != MEMLINK_OK) {
    echo "count2 error: {$ret}\n";
    exit(-1);
}