1
0
mirror of synced 2024-12-05 03:06:05 +03:00

Fixing Console helpers to not override the default helpers provided

This commit is contained in:
Jonathan H. Wage 2010-04-16 13:23:07 -04:00
parent efb33a8365
commit aa70e6426d
2 changed files with 6 additions and 3 deletions

View File

@ -23,7 +23,7 @@ $connectionOptions = array(
$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
$helperSet = new \Symfony\Components\Console\Helper\HelperSet(array(
$helpers = array(
'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em)
));
);

View File

@ -13,7 +13,10 @@ require __DIR__ . '/cli-config.php';
$cli = new \Symfony\Components\Console\Application('Doctrine Command Line Interface', Doctrine\Common\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$helperSet = $cli->getHelperSet();
foreach ($helpers as $name => $helper) {
$helperSet->set($helper, $name);
}
$cli->addCommands(array(
// DBAL Commands
new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),