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);

View File

@@ -82,6 +82,7 @@
"roave/security-advisories": "dev-master",
"silex/silex": "^1.3.0",
"silex/web-profiler": "~1.0",
"simple-bus/doctrine-orm-bridge": "^4.0",
"simple-bus/message-bus": "^2.1",
"simple-bus/jms-serializer-bridge": "^1.0",
"simple-bus/serialization": "^2.0",

58
composer.lock generated
View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "482f821dcf6aa1ee93eb82e4fe22aa1d",
"content-hash": "26a63d5fa55bb410eb5347ba41ff5c6a",
"hash": "d373365ac5a7284c4226047322aba87b",
"content-hash": "bfc7b957c6ad61773783e4c5b0e63fb4",
"packages": [
{
"name": "alchemy-fr/tcpdf-clone",
@@ -4410,6 +4410,60 @@
"homepage": "http://silex.sensiolabs.org/",
"time": "2015-06-04 14:27:33"
},
{
"name": "simple-bus/doctrine-orm-bridge",
"version": "v4.0.0",
"source": {
"type": "git",
"url": "https://github.com/SimpleBus/DoctrineORMBridge.git",
"reference": "46df998f26940d9525f8e35c40641328c679dbfe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SimpleBus/DoctrineORMBridge/zipball/46df998f26940d9525f8e35c40641328c679dbfe",
"reference": "46df998f26940d9525f8e35c40641328c679dbfe",
"shasum": ""
},
"require": {
"beberlei/assert": "~2.0",
"doctrine/orm": "~2.2",
"php": ">=5.4",
"simple-bus/message-bus": "~2.0"
},
"require-dev": {
"matthiasnoback/doctrine-orm-test-service-provider": "~2.0",
"phpunit/phpunit": "~4.5",
"satooshi/php-coveralls": "~0.6"
},
"suggest": {
"simple-bus/symfony-bridge": "Bridge for using command buses and event buses with Symfony"
},
"type": "library",
"autoload": {
"psr-4": {
"SimpleBus\\DoctrineORMBridge\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Matthias Noback",
"email": "matthiasnoback@gmail.com",
"homepage": "http://php-and-symfony.matthiasnoback.nl"
}
],
"description": "Doctrine ORM bridge for using command and event buses",
"homepage": "http://github.com/SimpleBus/DoctrineORMBridge",
"keywords": [
"command bus",
"doctrine",
"event bus"
],
"time": "2015-04-29 12:27:27"
},
{
"name": "simple-bus/jms-serializer-bridge",
"version": "v1.0.3",