Ejemplo n.º 1
0
<?php

$tt = new TokyoTyrant("localhost");
$tt->put("key", "value");
echo $tt->get("key");
Ejemplo n.º 2
0
    $keys[] = $k;
    if ($i >= $onum) {
        $total += $i;
        $i = 0;
        $udatas = array();
        $sdatas = $st->get($keys);
        foreach ($mdatas as $mk => $mv) {
            if ($sdatas[$mk] != $mv) {
                $udatas[$mk] = $mv;
                $utotal += 1;
            }
        }
        $mdatas = array();
        $keys = array();
        if ($udatas) {
            $st->put($udatas);
        }
        echo record_time($stime, " process {$total} {$utotal}  items ");
    }
}
if ($i > 0) {
    $sdatas = $st->get($keys);
    foreach ($mdatas as $mk => $mv) {
        if ($sdatas[$mk] != $mv) {
            $udatas[$mk] = $mv;
            $utotal += 1;
        }
    }
    if ($udatas) {
        $st->put($udatas);
    }