$value, 'expire' => time() + $expire); } static function get($name){ if(!isset(self::$data[$name])) return null; $_value = self::$data[$name]; if(count($_value) == 0) return null; extract($_value); if(isset($expire) && $expire < time()) { unset(self::$data[$name]); $value = null; } return $value; } static function kill($name){ if(isset(self::$data[$name])) unset(self::$data[$name]); } static function clear(){ file_put_contents(WPDM_CACHE_DIR . '/temp-storage.txt', ''); } function __destruct() { if(is_array(self::$data)) { $data = Crypt::encrypt(self::$data); file_put_contents(WPDM_CACHE_DIR . '/temp-storage.txt', $data); } } static function saveData() { if(is_array(self::$data)) { $data = Crypt::encrypt(self::$data); file_put_contents(WPDM_CACHE_DIR . '/temp-storage.txt', $data); } } } new TempStorage();