]> git.mjollnir.org Git - moodle.git/commitdiff
Revert - dmllib: check $MCACHE->status() before using it
authormartinlanghoff <martinlanghoff>
Thu, 20 Sep 2007 06:45:29 +0000 (06:45 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 20 Sep 2007 06:45:29 +0000 (06:45 +0000)
lib/dmllib.php

index 0fe598a61c180fa1924677edb9c602493162d7b3..e8dd30674f231fbd63b0b00e9b6e932010a9040d 100644 (file)
@@ -2394,7 +2394,7 @@ function rcache_set($table, $id, $rec) {
     } else {
         $key   = $table . '|' . $id;
 
-        if (isset($MCACHE) && $MCACHE->status()) {
+        if (isset($MCACHE)) {
             // $table is a flag used to mark
             // a table as dirty & uncacheable
             // when an UPDATE or DELETE not bound by ID
@@ -2427,7 +2427,7 @@ function rcache_unset($table, $id) {
         }
     } else {
         $key   = $table . '|' . $id;
-        if (isset($MCACHE) && $MCACHE->status()) {
+        if (isset($MCACHE)) {
             $MCACHE->delete($key);
         }
     }
@@ -2461,7 +2461,7 @@ function rcache_get($table, $id) {
         }
     }
 
-    if (isset($MCACHE) && $MCACHE->status()) {
+    if (isset($MCACHE)) {
         $key   = $table . '|' . $id;
         // we set $table as a flag used to mark
         // a table as dirty & uncacheable
@@ -2510,7 +2510,7 @@ function rcache_getforfill($table, $id) {
         return rcache_get($table, $id);
     }
 
-    if (isset($MCACHE) && $MCACHE->status()) {
+    if (isset($MCACHE)) {
         $key   = $table . '|' . $id;
         // if $table is set - we won't take the
         // lock either
@@ -2543,7 +2543,7 @@ function rcache_getforfill($table, $id) {
 function rcache_releaseforfill($table, $id) {
     global $CFG, $MCACHE;
 
-    if (isset($MCACHE) && $MCACHE->status()) {
+    if (isset($MCACHE)) {
         $key   = $table . '|' . $id;
         return $MCACHE->releaseforfill($key);
     }
@@ -2570,7 +2570,7 @@ function rcache_unset_table ($table) {
         return true;
     }
 
-    if (isset($MCACHE) && $MCACHE->status()) {
+    if (isset($MCACHE)) {
         // at least as long as content keys to ensure they expire
         // before the dirty flag
         $MCACHE->set($table, true, $CFG->rcachettl);