]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed context caching (wasn't using globals)
authormoodler <moodler>
Wed, 23 Aug 2006 01:29:52 +0000 (01:29 +0000)
committermoodler <moodler>
Wed, 23 Aug 2006 01:29:52 +0000 (01:29 +0000)
lib/accesslib.php

index d943930b3d94c1d27fa72c8904d8050b622ad158..d861a818cdb861a1e139f5d8dc2a0be7a10ddd4e 100755 (executable)
@@ -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];
     }