From: moodler Date: Wed, 23 Aug 2006 01:29:52 +0000 (+0000) Subject: Fixed context caching (wasn't using globals) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d9a35e127006120537543506f2271662a3cfff9e;p=moodle.git Fixed context caching (wasn't using globals) --- diff --git a/lib/accesslib.php b/lib/accesslib.php index d943930b3d..d861a818cd 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -841,6 +841,8 @@ function create_context($aggregatelevel, $instanceid) { */ function get_context_instance($aggregatelevel=NULL, $instance=SITEID) { + global $context_cache, $context_cache_id; + /// If no level is supplied then return the current global context if there is one if (empty($aggregatelevel)) { if (empty($CONTEXT)) { @@ -878,6 +880,8 @@ function get_context_instance($aggregatelevel=NULL, $instance=SITEID) { */ function get_context_instance_by_id($id) { + global $context_cache, $context_cache_id; + if (isset($context_cache_id[$id])) { // Already cached return $context_cache_id[$id]; }