summaryrefslogtreecommitdiffstats
path: root/install.php
diff options
context:
space:
mode:
Diffstat (limited to 'install.php')
-rw-r--r--install.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/install.php b/install.php
index fa1258e0..f0bb1c72 100644
--- a/install.php
+++ b/install.php
@@ -43,6 +43,17 @@ define('UPDATE_NOOP', 'UPDATE_NOOP'); // Nothing had to be done, everything is u
define('UPDATE_RETRY', 'UPDATE_RETRY'); // Install/update process failed, but should be retried later.
define('UPDATE_FAILED', 'UPDATE_FAILED'); // Fatal error occurred, retry will not resolve the issue.
+/**
+ * Take the return value of a Database::exec() call and emit failure
+ * if it's false.
+ */
+function handleUpdateResult($res)
+{
+ if ($res !== false)
+ return;
+ finalResponse(UPDATE_FAILED, Database::lastError());
+}
+
/*
* Helper functions for dealing with the database
*/