Command db:migrate should work even if DB_RUN_MIGRATIONS is false
Fixes #4818
This commit is contained in:
committed by
Frédéric Guillot
parent
bd8bcfbc37
commit
277357277f
11
cli
11
cli
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Input\ArgvInput;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
|
|
||||||
if (php_sapi_name() !== 'cli') {
|
if (php_sapi_name() !== 'cli') {
|
||||||
@@ -10,8 +11,14 @@ if (php_sapi_name() !== 'cli') {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
require __DIR__.'/app/common.php';
|
require __DIR__.'/app/common.php';
|
||||||
$container['dispatcher']->dispatch('app.bootstrap', new Event);
|
|
||||||
$container['cli']->run();
|
$input = new ArgvInput();
|
||||||
|
|
||||||
|
if (! in_array($input->getFirstArgument(), ['db:migrate', 'db:version'])) {
|
||||||
|
$container['dispatcher']->dispatch('app.bootstrap', new Event);
|
||||||
|
}
|
||||||
|
|
||||||
|
$container['cli']->run($input);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo $e->getMessage().PHP_EOL;
|
echo $e->getMessage().PHP_EOL;
|
||||||
exit(255);
|
exit(255);
|
||||||
|
|||||||
Reference in New Issue
Block a user