Change ORM instantiation position.

This commit is contained in:
Benoît Burnichon
2015-09-15 15:59:46 +02:00
parent d9604ae300
commit 829a69ad4a
3 changed files with 72 additions and 15 deletions

View File

@@ -68,19 +68,6 @@ $cli = new CLI("
under certain conditions; type `about:license' for details.\n\n"
. ' Phraseanet Developer Tools ', $version->getName() . ' ' . $version->getNumber());
if ($cli['configuration.store']->isSetup()) {
$cli->loadPlugins();
$helpers = [
'db' => new ConnectionHelper($cli['orm.em']->getConnection()),
'em' => new EntityManagerHelper($cli['orm.em'])
];
$helperSet = $cli['console']->getHelperSet();
foreach ($helpers as $name => $helper) {
$helperSet->set($helper, $name);
}
}
$cli->command(new TranslationDumper());
$cli->command(new InstallAll());
@@ -126,4 +113,19 @@ $cli['console']->addCommands([
new VersionCommand(),
]);
$cli->loadPlugins();
if ($cli['configuration.store']->isSetup()) {
$cli->loadPlugins();
$helpers = [
'db' => new ConnectionHelper($cli['orm.em']->getConnection()),
'em' => new EntityManagerHelper($cli['orm.em'])
];
$helperSet = $cli['console']->getHelperSet();
foreach ($helpers as $name => $helper) {
$helperSet->set($helper, $name);
}
}
exit(is_int($cli->run()) ? : 1);