浏览代码

[DependencyInjection] added public attribute when dumping a container to XML

Fabien Potencier 14 年之前
父节点
当前提交
0b165e13b2
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php

+ 3 - 0
src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php

@@ -122,6 +122,9 @@ class XmlDumper extends Dumper
         if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) {
             $service->setAttribute('scope', $scope);
         }
+        if (!$definition->isPublic()) {
+            $service->setAttribute('public', 'false');
+        }
 
         foreach ($definition->getTags() as $name => $tags) {
             foreach ($tags as $attributes) {