[BUGFIX] max_execution_time check fails 09/20709/2
authorAdrian Dymorz <dev@adrian.dymorz.ch>
Sun, 12 May 2013 01:03:36 +0000 (03:03 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 12 May 2013 01:05:54 +0000 (03:05 +0200)
Fix for wrong error message in system environment check. Checking
max_execution_time fails in cli mode.

Resolves: #48095
Releases: 6.1, 6.2
Change-Id: I5cfe59dfab680d49a2b1b023a09e2d8d458345f4
Reviewed-on: https://review.typo3.org/20709
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index 843537b..d554b58 100644 (file)
@@ -317,15 +317,24 @@ class Check {
                $minimumMaximumExecutionTime = 30;
                $recommendedMaximumExecutionTime = 240;
                $currentMaximumExecutionTime = ini_get('max_execution_time');
-               if ($currentMaximumExecutionTime == 0 && PHP_SAPI !== 'cli') {
-                       $status = new WarningStatus();
-                       $status->setTitle('Infinite PHP script execution time');
-                       $status->setMessage(
-                               'Your max_execution_time is set to 0 (infinite). While TYPO3 is fine' .
-                               ' with this, you risk a denial-of-service of you system if for whatever' .
-                               ' reason some script hangs in an infinite loop. You are usually on safe side ' .
-                               ' if max_execution_time is reduced to ' . $recommendedMaximumExecutionTime
-                       );
+               if ($currentMaximumExecutionTime == 0) {
+                       if (PHP_SAPI === 'cli') {
+                               $status = new OkStatus();
+                               $status->setTitle('Infinite PHP script execution time');
+                               $status->setMessage(
+                                       'Maximum PHP script execution time is always set to infinite (0) in cli mode.' .
+                                       ' The setting used for web requests can not be checked from command line.'
+                               );
+                       } else {
+                               $status = new WarningStatus();
+                               $status->setTitle('Infinite PHP script execution time');
+                               $status->setMessage(
+                                       'Your max_execution_time is set to 0 (infinite). While TYPO3 is fine' .
+                                       ' with this, you risk a denial-of-service of you system if for whatever' .
+                                       ' reason some script hangs in an infinite loop. You are usually on safe side ' .
+                                       ' if max_execution_time is reduced to ' . $recommendedMaximumExecutionTime
+                               );
+                       }
                } elseif ($currentMaximumExecutionTime < $minimumMaximumExecutionTime) {
                        $status = new ErrorStatus();
                        $status->setTitle('Low PHP script execution time');