浏览代码

[FrameworkBundle] fixed init:bundle

Fabien Potencier 14 年之前
父节点
当前提交
4e0ecfdf81
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

+ 3 - 0
src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

@@ -51,6 +51,9 @@ class InitBundleCommand extends Command
             throw new \InvalidArgumentException('The namespace must end with Bundle.');
         }
 
+        $pos = strrpos($namespace, '\\');
+        $bundle = substr($namespace, $pos ? $pos + 1 : 0);
+
         $dir = $input->getArgument('dir');
         $output->writeln(sprintf('Initializing bundle "<info>%s</info>" in "<info>%s</info>"', $bundle, $dir));