if (is_callable($load_callback)) { call_user_func_array($load_callback, array($parameters)); } else { do_action('fw_cache_load', $parameters); } unset($parameters); // try again to get value (maybe someone loaded it) $value = fw_akg($keys, self::$cache, self::$not_found_value, $keys_delimiter); if ($value === self::$not_found_value) { throw new FW_Cache_Not_Found_Exception('Cache key not found: ' . $keys); } } return $value; } /** * Empty the cache */ public static function clear() { self::$cache = array(); } } FW_Cache::_init(); class FW_Cache_Not_Found_Exception extends Exception { } /** * 3000: ~15 times */ declare (ticks=3000); register_tick_function(array('FW_Cache', 'free_memory'));