Esempio n. 1
0
    exit(-1);
}
$ret = $m->create_list($key, 12, "4:3:1");
if ($ret != MEMLINK_OK) {
    echo "create error: {$key}\n";
    exit(-1);
}
for ($i = 0; $i < 100; $i++) {
    $val = sprintf("%012d", $i);
    $ret = $m->insert($key, $val, strlen($val), "8:1:1", 0);
    if ($ret != MEMLINK_OK) {
        echo "insert error! {$ret} {$key} {$val}\n";
        exit(-1);
    }
}
$ret = $m->stat($key);
if (is_null($ret)) {
    echo "stat error: {$key}\n";
    exit(-1);
}
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) {