static function testTTUDB() { $u = 1001; $tn = new TTUDB($u); $group = 'g1'; $now = time(); record_time($st); $data_with_noid = array('me' => 'im $data_with_noid', 'oth' => array('dffd', 'dfd')); $data_with_noid['tm'] = $now; $tn->puto($data_with_noid, 'group'); print_r($data_with_noid); record_time($st, 'print_r($data_with_noid);'); print_r($tn->get()); record_time($st, '$tn->get()'); print_r($tn->getbyid($data_with_noid['id'])); record_time($st, '$tn->getbyid($data_with_noid["id"])'); print_r($tn->getbyids(array($data_with_noid['id']))); record_time($st, '$tn->getbyids(array($data_with_noid["id"]))'); $data_with_id['id'] = $data_with_noid['id']; $data_with_id['new'] = 'im new field'; $data_with_id['me'] = 'im new field'; print_r($data_with_id); $tn->puto($data_with_id, 'g'); print_r($data_with_id); record_time($st, '$tn->puto($data_with_id,$u,\'g\',$t)'); print_r($tn->getbyid($data_with_noid['id'])); record_time($st, '$tn->getbyid($data_with_noid["id"],$u)'); $data_with_id = array(); $data_with_id['id'] = $data_with_noid['id']; $data_with_id['new'] = 'im new field nokeep'; $data_with_id['me'] = 'im new field nokeep'; $tn->puto($data_with_id, 'g', false); print_r($data_with_id); record_time($st, '$tn->puto($d:wata_with_id,$u,\'g\',$t,false)'); //for field $tn->numch("money"); $tn->numch("gem"); record_time($st, '$tn->numch("money")'); record_time($st, '$tn->getf("money")=' . print_r($tn->getf($u, "money"), true)); record_time($st, '$tn->getf(array("money"))=' . print_r($tn->getf(array("money")), true)); record_time($st, '$tn->getf()=' . print_r($tn->getf(), true)); $pair['k1'] = 'v1'; $pair['k2'] = 'v2'; $pair['k3'] = 'v3'; $tn->mputf($pair); $tn->putf('putf', 'i am insert by putf'); record_time($st, ' put pair'); record_time($st, '$tn->numch("money")'); record_time($st, '$tn->getf("money")=' . print_r($tn->getf("money"))); record_time($st, '$tn->getf(array("money"))=' . print_r($tn->getf(array("money")))); record_time($st, '$tn->getf(array("putf","money"))=' . print_r($tn->getf(array("money", 'putf')))); record_time($st, '$tn->getf($u)=' . print_r($tn->getf($u))); $data = array('me' => 'im in a array'); $data['index'] = count($datas); $datas[] = $data; $data['index'] = count($datas); $datas[] = $data; $data['index'] = count($datas); $datas[] = $data; record_time($st, '$tn->mputo($datas,$u)=' . print_r($tn->mputo($datas, 'new_group'))); record_time($st, '$tn->getf($u,new_group)=' . print_r($tn->get('new_group'))); for ($i = 1; $i < 11; $i++) { $achieve = array(); $achieve['tag'] = $i; $achieve['is_done'] = '0'; $achieve['finish_num'] = '0'; $tn->puto($achieve, TT::ACHIVE_GROUP); $ret['ac'][] = $achieve; } $str = '$tn->get( TT::ACHIVE_GROUP )'; echo "{$str}="; $record_time($st); eval('print_r( ' . $str . ');'); record_time($st, $str); echo "\n"; $str = '$tn->numch("newdd")'; echo "{$str}="; eval('print_r( ' . $str . ');'); echo "\n"; $str = '$tn->getAll()'; echo "{$str}="; eval('print_r( ' . $str . ');'); echo "\n"; }
public function TTUser($u, $only_read = false, $name = 'main') { parent::TTUDB($u, $only_read, $name); }
public function TTUDB($u, $name = 'data', $only_read = false) { parent::TTUDB($u, $name, $only_read); }