From b24464ac9d6bd12b78740197531b582e0fdcd5d4 Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 8 Apr 2009 16:28:00 +0000 Subject: Removed unused experimental cache functions git-svn-id: https://code.elgg.org/elgg/trunk@3196 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 66 -------------------------------------------------- 1 file changed, 66 deletions(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 872e95c56..81d2290f6 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -156,72 +156,6 @@ return false; } - /** - * Generate a view hash [EXPERIMENTAL]. - * - * @param string $view The view name - * @param array $vars The view parameters - * @return string The hash. - */ - function elgg_get_viewhash($view, $vars) - { - $unchanged_vars = unserialize(serialize($vars)); - - // This is a bit of a hack, but basically we have to remove things that change on each pageload - if (isset($unchanged_vars['entity']->last_action)) $unchanged_vars['entity']->last_action = 0; - if (isset($unchanged_vars['entity']->prev_last_action)) $unchanged_vars['entity']->prev_last_action = 0; - - if (isset($unchanged_vars['user']->last_action)) $unchanged_vars['user']->last_action = 0; - if (isset($unchanged_vars['user']->prev_last_action)) $unchanged_vars['user']->prev_last_action = 0; - - - return md5(current_page_url() . $view . serialize($unchanged_vars)); // This should be enough to stop artefacts - - } - - - /** - * Get a cached view based on its hash. - * - * @param string $viewhash - * @return string or false on if no cache returned. - */ - function elgg_get_cached_view($viewhash) - { - global $view_cache, $VIEW_CACHE_DISABLED, $CONFIG; - - if (($VIEW_CACHE_DISABLED) || (!$CONFIG->viewcache)) return false; - - if ((!$view_cache) && (is_memcache_available())) - $view_cache = new ElggMemcache('view_cache'); - if ($view_cache) { - - $cached_view = $view_cache->load($viewhash); - - if ($cached_view) - { - error_log("MARCUS : LOADED $view:$viewhash from cache"); - return $cached_view; - } - else - error_log("MARCUS : View $view:$viewhash not cached"); - - } - - return false; - } - - /** - * Temporarily disable view caching. - * - */ - function elgg_disable_view_cache() - { - global $VIEW_CACHE_DISABLED; - - $VIEW_CACHE_DISABLED = true; - } - /** * Handles templating views * -- cgit v1.2.3