summaryrefslogtreecommitdiffstats
path: root/install.php
diff options
context:
space:
mode:
authorSimon Rettberg2021-03-17 15:39:55 +0100
committerSimon Rettberg2021-03-17 15:39:55 +0100
commitdc516c24685518b41bcce0751caf286dc65e471f (patch)
treec4db8569fe044752f9cf4ba58c8c5ad986a27b55 /install.php
parentAdd missing changes (diff)
downloadslx-admin-dc516c24685518b41bcce0751caf286dc65e471f.tar.gz
slx-admin-dc516c24685518b41bcce0751caf286dc65e471f.tar.xz
slx-admin-dc516c24685518b41bcce0751caf286dc65e471f.zip
[locations/rebootcontrol] Change ENUM constants; display next event
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
*/