+
+ }
+
+ /**
+ * Saves the database from memory to disk
+ *
+ * @param string $pageCacheDir page cache directory
+ */
+ public function savedb($pageCacheDir)
+ {
+ if (!$this->_loggedIn) {
+ // TODO: raise an Exception instead
+ die('You are not authorized to change the database.');
+ }
+
+ $this->writeDB();
+
+ invalidateCaches($pageCacheDir);