浏览代码

Only call registerCommand on bundles that is an instance of Bundle

Fixes GH-5133
Henrik Bjørnskov 12 年之前
父节点
当前提交
0b78fdffa4
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/Symfony/Bundle/FrameworkBundle/Console/Application.php

+ 5 - 1
src/Symfony/Bundle/FrameworkBundle/Console/Application.php

@@ -17,6 +17,7 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 use Symfony\Component\HttpKernel\KernelInterface;
 use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\HttpKernel\Bundle;
 
 /**
  * Application.
@@ -78,8 +79,11 @@ class Application extends BaseApplication
     protected function registerCommands()
     {
         $this->kernel->boot();
+
         foreach ($this->kernel->getBundles() as $bundle) {
-            $bundle->registerCommands($this);
+            if ($bundle instanceof Bundle) {
+                $bundle->registerCommands($this);
+            }
         }
     }
 }