diff options
author | icewind1991 <robin@icewind.nl> | 2013-11-25 07:06:48 -0800 |
---|---|---|
committer | icewind1991 <robin@icewind.nl> | 2013-11-25 07:06:48 -0800 |
commit | 019f3299b0138e8cad3c66c9199a5548aa457773 (patch) | |
tree | 5a66d11b0d6db5c7a442b7da1ecab4d66641b2bb | |
parent | 31d0ba03449bd0f6b8f245e456e8ba83b99413cf (diff) | |
parent | 317d421874158cefba5fae80398513a453c38f77 (diff) | |
download | nextcloud-server-019f3299b0138e8cad3c66c9199a5548aa457773.tar.gz nextcloud-server-019f3299b0138e8cad3c66c9199a5548aa457773.zip |
Merge pull request #6030 from owncloud/cli-errors
provide more cli friendly error messages when in cli mode
-rw-r--r-- | lib/base.php | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/lib/base.php b/lib/base.php index 865d174d212..187cedf9422 100644 --- a/lib/base.php +++ b/lib/base.php @@ -178,11 +178,19 @@ class OC { if (file_exists(OC::$SERVERROOT . "/config/config.php") and !is_writable(OC::$SERVERROOT . "/config/config.php")) { $defaults = new OC_Defaults(); - OC_Template::printErrorPage( - "Can't write into config directory!", - 'This can usually be fixed by ' - .'<a href="' . \OC_Helper::linkToDocs('admin-dir_permissions') . '" target="_blank">giving the webserver write access to the config directory</a>.' - ); + if (self::$CLI) { + echo "Can't write into config directory!\n"; + echo "This can usually be fixed by giving the webserver write access to the config directory\n"; + echo "\n"; + echo "See " . \OC_Helper::linkToDocs('admin-dir_permissions') . "\n"; + exit; + } else { + OC_Template::printErrorPage( + "Can't write into config directory!", + 'This can usually be fixed by ' + .'<a href="' . \OC_Helper::linkToDocs('admin-dir_permissions') . '" target="_blank">giving the webserver write access to the config directory</a>.' + ); + } } } @@ -480,7 +488,14 @@ class OC { $errors = OC_Util::checkServer(); if (count($errors) > 0) { - OC_Template::printGuestPage('', 'error', array('errors' => $errors)); + if (self::$CLI) { + foreach ($errors as $error) { + echo $error['error']."\n"; + echo $error['hint'] . "\n\n"; + } + } else { + OC_Template::printGuestPage('', 'error', array('errors' => $errors)); + } exit; } |