mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Add workaround for hitting XDebugs fairly conservative nesting level limit
This commit is contained in:
parent
e4675d7172
commit
407913f2cf
@ -195,6 +195,11 @@ define('PR_LOW',10);
|
||||
*/
|
||||
increase_memory_limit_to('64M');
|
||||
|
||||
/**
|
||||
* Ensure we don't run into xdebug's fairly conservative infinite recursion protection limit
|
||||
*/
|
||||
increase_xdebug_nesting_level_to(200);
|
||||
|
||||
/**
|
||||
* Set default encoding
|
||||
*/
|
||||
@ -433,6 +438,19 @@ function get_increase_memory_limit_max() {
|
||||
return $_increase_memory_limit_max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the XDebug parameter max_nesting_level, which limits how deep recursion can go.
|
||||
* Only does anything if (a) xdebug is installed and (b) the new limit is higher than the existing limit
|
||||
*
|
||||
* @param int $limit - The new limit to increase to
|
||||
*/
|
||||
function increase_xdebug_nesting_level_to($limit) {
|
||||
if (function_exists('xdebug_enable')) {
|
||||
$current = ini_get('xdebug.max_nesting_level');
|
||||
if ((int)$current < $limit) ini_set('xdebug.max_nesting_level', $limit);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a memory string, such as 512M into an actual number of bytes.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user