Skip to content

Commit

Permalink
Revert "Merge pull request doctrine#118 from zolex/array-conf"
Browse files Browse the repository at this point in the history
This reverts commit f4daa30, reversing
changes made to 28eb1c1.
  • Loading branch information
Ocramius committed Oct 9, 2012
1 parent f4daa30 commit 17f21ce
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions src/DoctrineORMModule/Module.php
Expand Up @@ -88,40 +88,20 @@ public function onBootstrap(EventInterface $e)
$app = $e->getTarget();
$events = $app->getEventManager()->getSharedManager();

$migrationsConfig = null;
$config = $app->getServiceManager()->get('Configuration');
if (isset($config['doctrine']['migrations'])) {

$migrationsConfig = $config['doctrine']['migrations'];
}

// Attach to helper set event and load the entity manager helper.
$events->attach('doctrine', 'loadCli.post', function(EventInterface $e) use ($migrationsConfig) {
$events->attach('doctrine', 'loadCli.post', function(EventInterface $e) {
/* @var $cli \Symfony\Component\Console\Application */
$cli = $e->getTarget();

ConsoleRunner::addCommands($cli);
$commands = array(
$cli->addCommands(array(
new DiffCommand(),
new ExecuteCommand(),
new GenerateCommand(),
new MigrateCommand(),
new StatusCommand(),
new VersionCommand(),
);

if (is_array($migrationsConfig)) {

foreach ($commands as $command) {

if (method_exists($command, 'setArrayConfig')) {

$command->setArrayConfig($migrationsConfig);
}
}
}

$cli->addCommands($commands);
));

/* @var $sm ServiceLocatorInterface */
$sm = $e->getParam('ServiceManager');
Expand Down

0 comments on commit 17f21ce

Please sign in to comment.