function doLogin() { // $db = PiDb::init('hihus'); // $sql = 'select * from users where 1=1'; // $res = $db->query($sql); // while($l = $res->fetch(PDO::FETCH_ASSOC)){ // print_r($l); // } $mem = PiMc::get('users'); $mem->set("hihu", "100", 10 * 60); $s = $mem->get("hihu"); var_dump($s); }
public function getInstance($driver, $conf_name) { $instance = null; if ($driver == 'memcache') { $instance = PiMc::get($conf_name); } else { if ($driver == 'mongo') { $instance = null; } else { throw new Exception('queue.err can not getInstance:' . $driver, 8088); } } return $instance; }