SC_Cache_Ex::CACHEDIR, 'lifeTime' => SC_Cache_Ex::LIFETIME, 'automaticSerialization' => TRUE ); SC_Cache_Ex::$_instance = new Cache_Lite($options); } /** * Get Cache_Lite object. * * @return void */ public static function getInstance() { is_null(SC_Cache_Ex::$_instance) and SC_Cache_Ex::forge(); return SC_Cache_Ex::$_instance; } /** * Get data from cache. * * @param string $id cache id * @param string $group name of the cache group * @param int $lifeTime custom lifetime * @return mixed data of cache (else : false) */ public static function get($id, $group = 'default', $lifeTime = NULL) { $processor = SC_Cache_Ex::getInstance(); // set custom lifetime. !is_null($lifeTime) and $processor->setOption('lifeTime', $lifeTime); $cache = $processor->get($id, $group); // set back to default lifetime. !is_null($lifeTime) and $processor->setOption('lifeTime', SC_Cache_Ex::$_lifetime); return $cache; } /** * Save data into cache. * * @param mixed $data data of cache * @param string $id cache id * @param string $group name of the cache group * @return void */ public static function save($data, $id, $group = 'default') { $processor = SC_Cache_Ex::getInstance(); $processor->save($data, $id, $group); } /** * Clean cache. * * @param string $group name of the cache group * @return void */ public static function clean($group = FALSE) { $processor = SC_Cache_Ex::getInstance(); $processor->clean($group); } }