Skip to content

Commit

Permalink
Revert - dmllib: check $MCACHE->status() before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlanghoff committed Sep 20, 2007
1 parent b874e68 commit 2b33092
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/dmllib.php
Expand Up @@ -2240,7 +2240,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
Expand Down Expand Up @@ -2273,7 +2273,7 @@ function rcache_unset($table, $id) {
}
} else {
$key = $table . '|' . $id;
if (isset($MCACHE) && $MCACHE->status()) {
if (isset($MCACHE)) {
$MCACHE->delete($key);
}
}
Expand Down Expand Up @@ -2307,7 +2307,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
Expand Down Expand Up @@ -2356,7 +2356,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
Expand Down Expand Up @@ -2389,7 +2389,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);
}
Expand All @@ -2416,7 +2416,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);
Expand Down

0 comments on commit 2b33092

Please sign in to comment.