]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add warning on admin screen when set_time_limit is unavailable 3802/head
authorKo- <k.stoffelen@cs.ru.nl>
Thu, 16 Mar 2017 10:48:28 +0000 (11:48 +0100)
committerKo- <k.stoffelen@cs.ru.nl>
Thu, 16 Mar 2017 10:48:28 +0000 (11:48 +0100)
core/js/setupchecks.js
settings/Controller/CheckSetupController.php

index fcbbba6af6215a8a43dc62e04a435a4870943cca..53b2e46f90a8c5bd5ffdf3410eee7294d9323dcb 100644 (file)
                                                        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'),
index 016f6a1dab275bf155124ecad28fd54a1ae2467a..5e2aa365f6712c09aacbb589174f018199058e62 100644 (file)
@@ -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(),
                        ]
                );
        }