Esempio n. 1
0
 /**
  * @param string   $key
  * @param mixed    $value
  * @param int|bool $ltime Lifetime in seconds otherwise cache forever.
  *
  * @return bool
  */
 public function put($key, $value, $ltime = false)
 {
     try {
         $value = Pack::wrap($value, $ltime);
     } catch (\RuntimeException $ret) {
         return false;
     }
     if (true === $this->has($key)) {
         return dba_replace($key, $value, $this->dba);
     }
     return dba_insert($key, $value, $this->dba);
 }