diff --git a/app/bundles/CoreBundle/Controller/AjaxController.php b/app/bundles/CoreBundle/Controller/AjaxController.php index f1708bf4435..7fceb0668ab 100644 --- a/app/bundles/CoreBundle/Controller/AjaxController.php +++ b/app/bundles/CoreBundle/Controller/AjaxController.php @@ -565,6 +565,13 @@ public function updateDatabaseMigrationAction(Request $request) $application = new Application($this->get('kernel')); $application->setAutoExit(false); $output = new BufferedOutput(); + + $minExecutionTime = 300; + $maxExecutionTime = (int) ini_get('max_execution_time'); + if ($maxExecutionTime > 0 && $maxExecutionTime < $minExecutionTime) { + ini_set('max_execution_time', $minExecutionTime); + } + $result = $application->run($input, $output); } diff --git a/app/bundles/CoreBundle/Controller/UpdateController.php b/app/bundles/CoreBundle/Controller/UpdateController.php index d045836794a..64cb7a1f9a6 100644 --- a/app/bundles/CoreBundle/Controller/UpdateController.php +++ b/app/bundles/CoreBundle/Controller/UpdateController.php @@ -74,6 +74,13 @@ public function schemaAction() $application = new Application($this->get('kernel')); $application->setAutoExit(false); $output = new BufferedOutput(); + + $minExecutionTime = 300; + $maxExecutionTime = (int) ini_get('max_execution_time'); + if ($maxExecutionTime > 0 && $maxExecutionTime < $minExecutionTime) { + ini_set('max_execution_time', $minExecutionTime); + } + $result = $application->run($input, $output); $outputBuffer = $output->fetch(); diff --git a/upgrade.php b/upgrade.php index ca02cc0ce76..9be6e8344c5 100644 --- a/upgrade.php +++ b/upgrade.php @@ -540,6 +540,12 @@ function apply_critical_migrations() $success = true; + $minExecutionTime = 300; + $maxExecutionTime = (int) ini_get('max_execution_time'); + if ($maxExecutionTime > 0 && $maxExecutionTime < $minExecutionTime) { + ini_set('max_execution_time', $minExecutionTime); + } + if ($criticalMigrations) { foreach ($criticalMigrations as $version) { if (!run_symfony_command('doctrine:migrations:migrate', ['--no-interaction', '--env=prod', '--no-debug', $version])) { @@ -558,6 +564,12 @@ function apply_critical_migrations() */ function apply_migrations() { + $minExecutionTime = 300; + $maxExecutionTime = (int) ini_get('max_execution_time'); + if ($maxExecutionTime > 0 && $maxExecutionTime < $minExecutionTime) { + ini_set('max_execution_time', $minExecutionTime); + } + return run_symfony_command('doctrine:migrations:migrate', ['--no-interaction', '--env=prod', '--no-debug']); }