From 7d61c003da253cd8fce7a71b1fffb721ac229c20 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 10 Apr 2011 12:20:38 +0200 Subject: [PATCH] [FrameworkBundle] Allow init:bundle to be called with / as namespace separator --- .../Bundle/FrameworkBundle/Command/InitBundleCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php index 4247ba68b0..72b84c24b6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/InitBundleCommand.php +++ b/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)); }