Increase xdebug.max_nesting_level to 1000 if required in bin/console script

Fix issue #411
This commit is contained in:
Jan Böhmer 2023-10-25 17:05:24 +02:00
parent 7239aef47f
commit a1c680d14d

View file

@ -4,6 +4,13 @@
use App\Kernel; use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
//Increase xdebug.max_nesting_level to 1000 if required (see issue #411)
//Check if xdebug extension is active, and xdebug.max_nesting_level is set to 256 or lower
if (extension_loaded('xdebug') && ((int) ini_get('xdebug.max_nesting_level')) <= 256) {
//Increase xdebug.max_nesting_level to 1000
ini_set('xdebug.max_nesting_level', '1000');
}
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
} }