瀏覽代碼

[DependencyInjection] fixed namespace problem when dumping to PHP

Fabien Potencier 15 年之前
父節點
當前提交
0cfdf2cbda
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

+ 1 - 1
src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

@@ -112,7 +112,7 @@ EOF;
     }
     else
     {
-      if ($class != "'".$definition->getClass()."'")
+      if ($class != "'".str_replace('\\', '\\\\', $definition->getClass())."'")
       {
         return sprintf("    \$class = %s;\n    \$instance = new \$class(%s);\n", $class, implode(', ', $arguments));
       }