aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/base.php b/lib/base.php
index a97b1b3dade..1f2e90deefd 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -575,15 +575,30 @@ class OC {
$errors = OC_Util::checkServer(\OC::$server->getConfig());
if (count($errors) > 0) {
if (self::$CLI) {
+ // Convert l10n string into regular string for usage in database
+ $staticErrors = [];
foreach ($errors as $error) {
echo $error['error'] . "\n";
echo $error['hint'] . "\n\n";
+ $staticErrors[] = [
+ 'error' => (string) $error['error'],
+ 'hint' => (string) $error['hint'],
+ ];
}
+
+ try {
+ \OC::$server->getConfig()->setAppValue('core', 'cronErrors', json_encode($staticErrors));
+ } catch(\Exception $e) {
+ echo('Writing to database failed');
+ }
+ exit();
} else {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printGuestPage('', 'error', array('errors' => $errors));
+ exit;
}
- exit;
+ } elseif(self::$CLI && \OC::$server->getConfig()->getSystemValue('installed', false)) {
+ \OC::$server->getConfig()->deleteAppValue('core', 'cronErrors');
}
//try to set the session lifetime