소스 검색

Merge remote branch 'Seldaek/init_bundle'

* Seldaek/init_bundle:
  [FrameworkBundle] Allow init:bundle to be called with / as namespace separator
Fabien Potencier 14 년 전
부모
커밋
27d2b049f8
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

+ 1 - 2
src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php

@@ -66,6 +66,7 @@ EOT
         }
 
         // validate namespace
+        $namespace = strtr($namespace, '/', '\\');
         if (preg_match('/[^A-Za-z0-9_\\\-]/', $namespace)) {
             throw new \InvalidArgumentException('The namespace contains invalid characters.');
         }
@@ -96,8 +97,6 @@ EOT
 
         $targetDir = $dir.strtr($namespace, '\\', '/');
 
-
-
         if (file_exists($targetDir)) {
             throw new \RuntimeException(sprintf('Bundle "%s" already exists.', $bundle));
         }