예제 #1
0
 protected function mem($key, $itemFetchedFromDB)
 {
     $mem_obj = new MyMemcached();
     if ($mem_obj->doFetch($key)) {
         $item = $mem_obj->doFetch($key);
     } else {
         $item = $itemFetchedFromDB;
         $mem_obj->doSave($key, $itemFetchedFromDB, 0);
     }
     return $item;
 }
예제 #2
0
 protected function deleteMem($key)
 {
     $mem = new MyMemcached($key);
     $mem->doDelete($key);
 }