Example #1
0
 public static function set($_key, $_value, $_lifetime = 60, $_options = null)
 {
     if ($_lifetime < 0) {
         $_lifetime = 0;
     }
     $cache = new self();
     $cache->setKey($_key);
     $cache->setValue($_value);
     $cache->setLifetime($_lifetime);
     if ($_options != null) {
         $cache->options = json_encode($_options, JSON_UNESCAPED_UNICODE);
     }
     return $cache->save();
 }