From aa70e6426dcc5e93bfcd20529a32fd211523b6cc Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Fri, 16 Apr 2010 13:23:07 -0400 Subject: [PATCH] Fixing Console helpers to not override the default helpers provided --- tools/sandbox/cli-config.php | 4 ++-- tools/sandbox/doctrine.php | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/sandbox/cli-config.php b/tools/sandbox/cli-config.php index 5c69499b0..afe1296e6 100644 --- a/tools/sandbox/cli-config.php +++ b/tools/sandbox/cli-config.php @@ -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) -)); \ No newline at end of file +); \ No newline at end of file diff --git a/tools/sandbox/doctrine.php b/tools/sandbox/doctrine.php index 152a9932e..3b4a856de 100644 --- a/tools/sandbox/doctrine.php +++ b/tools/sandbox/doctrine.php @@ -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(),