data = array(); $this->name = $name; $this->cache_to_option = $cache_to_option; if ($cache_to_option) { $this->data = icl_cache_get($name.'_cache_class'); if ($this->data == false){ $this->data = array(); } } } function get($key) { if(ICL_DISABLE_CACHE){ return null; } return isset($this->data[$key]) ? $this->data[$key] : false; } function has_key($key){ if(ICL_DISABLE_CACHE){ return false; } return array_key_exists($key, (array)$this->data); } function set($key, $value) { if(ICL_DISABLE_CACHE){ return; } $this->data[$key] = $value; if ($this->cache_to_option) { icl_cache_set($this->name.'_cache_class', $this->data); } } function clear() { $this->data = array(); if ($this->cache_to_option) { icl_cache_clear($this->name.'_cache_class'); } } } ?>