From 17fcef5aff019ca9bd5a1634a1253c0fed3ec15e Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 17 Dec 2015 21:59:33 +0100 Subject: [PATCH] [FrameworkBundle][HttpKernel] the finder is required to discover bundle commands --- src/Symfony/Bundle/FrameworkBundle/composer.json | 3 +-- src/Symfony/Component/HttpKernel/Bundle/Bundle.php | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index e68290ec1b..bbb16f953d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -20,6 +20,7 @@ "symfony/dependency-injection": "~2.3", "symfony/config": "~2.3,>=2.3.12", "symfony/event-dispatcher": "~2.1", + "symfony/finder": "~2.0,>=2.0.5", "symfony/http-foundation": "~2.3,>=2.3.19", "symfony/http-kernel": "~2.3,>=2.3.22", "symfony/filesystem": "~2.3", @@ -34,7 +35,6 @@ "symfony/console": "~2.3", "symfony/css-selector": "~2.0,>=2.0.5", "symfony/dom-crawler": "~2.0,>=2.0.5", - "symfony/finder": "~2.0,>=2.0.5", "symfony/intl": "~2.3", "symfony/security": "~2.3", "symfony/form": "~2.3.31", @@ -45,7 +45,6 @@ }, "suggest": { "symfony/console": "For using the console commands", - "symfony/finder": "For using the translation loader and cache warmer", "symfony/form": "For using forms", "symfony/validator": "For using validation", "symfony/serializer": "For using the serializer service", diff --git a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php index c037170d3c..8437af995a 100644 --- a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php +++ b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php @@ -170,6 +170,10 @@ abstract class Bundle extends ContainerAware implements BundleInterface return; } + if (!class_exists('Symfony\Component\Finder\Finder')) { + throw new \RuntimeException('You need the symfony/finder component to register bundle commands.'); + } + $finder = new Finder(); $finder->files()->name('*Command.php')->in($dir);