From 7ca046bfb596478a2fc9abd1f897b57f1c65cc12 Mon Sep 17 00:00:00 2001 From: fivestar Date: Fri, 7 Jan 2011 13:50:15 +0900 Subject: [PATCH] [DoctrineBundle] Fixed invalid regex in DoctrineCommand --- .../Bundle/DoctrineBundle/Command/DoctrineCommand.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php index 6dc4f1db99..0b0ed1155c 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php @@ -106,7 +106,7 @@ abstract class DoctrineCommand extends Command $connections = array(); $ids = $this->container->getServiceIds(); foreach ($ids as $id) { - preg_match('/doctrine.dbal.(.*)_connection/', $id, $matches); + preg_match('^doctrine\.dbal\.(.*)_connection$', $id, $matches); if ($matches) { $name = $matches[1]; $connections[$name] = $this->container->get($id); @@ -121,12 +121,13 @@ abstract class DoctrineCommand extends Command $entityManagers = array(); $ids = $this->container->getServiceIds(); foreach ($ids as $id) { - preg_match('/doctrine.orm.(.*)_entity_manager/', $id, $matches); + preg_match('/^doctrine\.orm\.(.*)_entity_manager$/', $id, $matches); if ($matches) { $name = $matches[1]; $entityManagers[$name] = $this->container->get($id); } } + return $entityManagers; } @@ -152,4 +153,4 @@ abstract class DoctrineCommand extends Command return $bundleMetadatas; } -} \ No newline at end of file +}