From 119995572abf165195732f1fb246382a987aa758 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Sun, 10 May 2015 12:11:20 -0700 Subject: [PATCH] Issue #2393531 by jcnventura, mrjmd, simonrjones, rpayanm, Cottser, akalata, eiriksm, David_Rothstein, dawehner, xjm: Maximum function nesting level of '100' reached --- core/modules/system/system.install | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 8f9c15f5575..4c7162cb2d3 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -664,6 +664,24 @@ function system_requirements($phase) { } } + // Check xdebug.max_nesting_level, as some pages will not work if it is too + // low. + if (extension_loaded('xdebug')) { + // Setting this value to 256 was considered adequate on Xdebug 2.3 + // (see http://bugs.xdebug.org/bug_view_page.php?bug_id=00001100) + $minimum_nesting_level = 256; + $current_nesting_level = ini_get('xdebug.max_nesting_level'); + + if ($current_nesting_level < $minimum_nesting_level) { + $requirements['xdebug_max_nesting_level'] = [ + 'title' => t('Xdebug settings'), + 'value' => t('xdebug.max_nesting_level is set to %value.', ['%value' => $current_nesting_level]), + 'description' => t('Set xdebug.max_nesting_level=@level in your PHP configuration as some pages in your Drupal site will not work when this setting is too low.', ['@level' => $minimum_nesting_level]), + 'severity' => REQUIREMENT_ERROR, + ]; + } + } + return $requirements; }