From: Ko- Date: Thu, 16 Mar 2017 10:48:28 +0000 (+0100) Subject: Add warning on admin screen when set_time_limit is unavailable X-Git-Tag: v12.0.0beta1~420^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=786ee72146773966ed774ee9a8128fbb2a2a713a;p=nextcloud-server.git Add warning on admin screen when set_time_limit is unavailable --- diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index fcbbba6af62..53b2e46f90a 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -160,6 +160,14 @@ type: OC.SetupChecks.MESSAGE_TYPE_INFO }); } + if(!data.isSettimelimitAvailable) { + messages.push({ + msg: t( + 'core', + 'The PHP function "set_time_limit" is not available. This could result in scripts being halted mid-execution, breaking your installation. We strongly recommend enabling this function.'), + type: OC.SetupChecks.MESSAGE_TYPE_WARNING + }); + } } else { messages.push({ msg: t('core', 'Error occurred while checking server setup'), diff --git a/settings/Controller/CheckSetupController.php b/settings/Controller/CheckSetupController.php index 016f6a1dab2..5e2aa365f67 100644 --- a/settings/Controller/CheckSetupController.php +++ b/settings/Controller/CheckSetupController.php @@ -285,6 +285,20 @@ class CheckSetupController extends Controller { return !(!extension_loaded('memcached') && extension_loaded('memcache')); } + /** + * Checks if set_time_limit is not disabled. + * + * @return bool + */ + private function isSettimelimitAvailable() { + if (function_exists('set_time_limit') + && strpos(@ini_get('disable_functions'), 'set_time_limit') === false) { + return true; + } + + return false; + } + /** * @return RedirectResponse */ @@ -411,6 +425,7 @@ Raw output 'codeIntegrityCheckerDocumentation' => $this->urlGenerator->linkToDocs('admin-code-integrity'), 'isOpcacheProperlySetup' => $this->isOpcacheProperlySetup(), 'phpOpcacheDocumentation' => $this->urlGenerator->linkToDocs('admin-php-opcache'), + 'isSettimelimitAvailable' => $this->isSettimelimitAvailable(), ] ); }