[TASK] Split xdebug.max_nesting_level into two error levels 17/32717/6
authorNicole Cordes <typo3@cordes.co>
Wed, 10 Sep 2014 15:39:11 +0000 (17:39 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 15 Sep 2014 13:23:58 +0000 (15:23 +0200)
The recommended xdebug.max_nesting_level was raised from 250 to
400 with issue #59391. Since the core itself usually works fine
with 250 and more is usually only needed for extensios with
deeply nested partials in fluid for example, the check is now
split to two error levels: Below 250 throws error level warning,
below 400 throws only a warning level warning.

Resolves: #61523
Related: #59391
Releases: master, 6.2
Change-Id: I366a97fe8077a389fff7f03935ad5b89d1469bc9
Reviewed-on: http://review.typo3.org/32717
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Classes/SystemEnvironment/Check.php

index 169ee46..600e947 100644 (file)
@@ -505,19 +505,31 @@ class Check {
        protected function checkXdebugMaxNestingLevel() {
                if (extension_loaded('xdebug')) {
                        $recommendedMaxNestingLevel = 400;
+                       $errorThreshold = 250;
                        $currentMaxNestingLevel = ini_get('xdebug.max_nesting_level');
-                       if ($currentMaxNestingLevel < $recommendedMaxNestingLevel) {
+                       if ($currentMaxNestingLevel < $errorThreshold) {
                                $status = new Status\ErrorStatus();
-                               $status->setTitle('PHP xdebug.max_nesting_level too low');
+                               $status->setTitle('PHP xdebug.max_nesting_level is critically low');
                                $status->setMessage(
                                        'xdebug.max_nesting_level=' . $currentMaxNestingLevel . LF .
                                        'This setting controls the maximum number of nested function calls to protect against' .
                                        ' infinite recursion. The current value is too low for TYPO3 CMS and must' .
-                                       ' be either raised or xdebug unloaded. A value of ' . $recommendedMaxNestingLevel .
+                                       ' be either raised or xdebug has to be unloaded. A value of ' . $recommendedMaxNestingLevel .
                                        ' is recommended. Warning: Expect fatal PHP errors in central parts of the CMS' .
                                        ' if the value is not raised significantly to:' . LF .
                                        'xdebug.max_nesting_level=' . $recommendedMaxNestingLevel
                                );
+                       } elseif ($currentMaxNestingLevel < $recommendedMaxNestingLevel) {
+                               $status = new Status\WarningStatus();
+                               $status->setTitle('PHP xdebug.max_nesting_level is low');
+                               $status->setMessage(
+                                       'xdebug.max_nesting_level=' . $currentMaxNestingLevel . LF .
+                                       'This setting controls the maximum number of nested function calls to protect against' .
+                                       ' infinite recursion. The current value is high enough for the TYPO3 CMS core to work' .
+                                       ' fine, but still some extensions could raise fatal PHP errors if the setting is not' .
+                                       ' raised further. A value of ' . $recommendedMaxNestingLevel . ' is recommended.' . LF .
+                                       'xdebug.max_nesting_level=' . $recommendedMaxNestingLevel
+                               );
                        } else {
                                $status = new Status\OkStatus();
                                $status->setTitle('PHP xdebug.max_nesting_level ok');