require_once '../../lib/base.php';
if (OC::checkUpgrade(false)) {
+ \OC_DB::enableCaching(false);
$updateEventSource = new OC_EventSource();
$watcher = new UpdateWatcher($updateEventSource);
OC_Hook::connect('update', 'success', $watcher, 'success');
$this->eventSource->close();
}
-}
\ No newline at end of file
+}
const BACKEND_MDB2=1;
static private $preparedQueries = array();
+ static private $cachingEnabled = true;
/**
* @var MDB2_Driver_Common
}
}
} else {
- if (isset(self::$preparedQueries[$query])) {
+ if (isset(self::$preparedQueries[$query]) and self::$cachingEnabled) {
return self::$preparedQueries[$query];
}
}
}
$result=new PDOStatementWrapper($result);
}
- if (is_null($limit) || $limit == -1) {
+ if ((is_null($limit) || $limit == -1) and self::$cachingEnabled ) {
self::$preparedQueries[$rawQuery] = $result;
}
return $result;
}
return $msg;
}
+
+ /**
+ * @param bool $enabled
+ */
+ static public function enableCaching($enabled) {
+ if (!$enabled) {
+ self::$preparedQueries = array();
+ }
+ self::$cachingEnabled = $enabled;
+ }
}
/**