services9.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  3. <parameters>
  4. <parameter key="baz_class">BazClass</parameter>
  5. <parameter key="foo_class">Bar\FooClass</parameter>
  6. <parameter key="foo">bar</parameter>
  7. </parameters>
  8. <services>
  9. <service id="foo" class="Bar\FooClass">
  10. <tag name="foo" foo="foo"/>
  11. <tag name="foo" bar="bar" baz="baz"/>
  12. <argument>foo</argument>
  13. <argument type="service" id="foo.baz"/>
  14. <argument type="collection">
  15. <argument key="%foo%">foo is %foo%</argument>
  16. <argument key="foobar">%foo%</argument>
  17. </argument>
  18. <argument>true</argument>
  19. <argument type="service" id="service_container"/>
  20. <property name="foo">bar</property>
  21. <property name="moo" type="service" id="foo.baz"/>
  22. <property name="qux" type="collection">
  23. <property key="%foo%">foo is %foo%</property>
  24. <property key="foobar">%foo%</property>
  25. </property>
  26. <call method="setBar">
  27. <argument type="service" id="bar"/>
  28. </call>
  29. <call method="initialize"/>
  30. <factory class="Bar\FooClass" method="getInstance"/>
  31. <configurator function="sc_configure"/>
  32. </service>
  33. <service id="foo.baz" class="%baz_class%">
  34. <factory class="%baz_class%" method="getInstance"/>
  35. <configurator class="%baz_class%" method="configureStatic1"/>
  36. </service>
  37. <service id="bar" class="Bar\FooClass">
  38. <argument>foo</argument>
  39. <argument type="service" id="foo.baz"/>
  40. <argument>%foo_bar%</argument>
  41. <configurator service="foo.baz" method="configure"/>
  42. </service>
  43. <service id="foo_bar" class="%foo_class%" shared="false"/>
  44. <service id="method_call1" class="Bar\FooClass">
  45. <file>%path%foo.php</file>
  46. <call method="setBar">
  47. <argument type="service" id="foo"/>
  48. </call>
  49. <call method="setBar">
  50. <argument type="service" id="foo2" on-invalid="null"/>
  51. </call>
  52. <call method="setBar">
  53. <argument type="service" id="foo3" on-invalid="ignore"/>
  54. </call>
  55. <call method="setBar">
  56. <argument type="service" id="foobaz" on-invalid="ignore"/>
  57. </call>
  58. <call method="setBar">
  59. <argument type="expression">service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")</argument>
  60. </call>
  61. </service>
  62. <service id="foo_with_inline" class="Foo">
  63. <call method="setBar">
  64. <argument type="service" id="inlined"/>
  65. </call>
  66. </service>
  67. <service id="inlined" class="Bar" public="false">
  68. <property name="pub">pub</property>
  69. <call method="setBaz">
  70. <argument type="service" id="baz"/>
  71. </call>
  72. </service>
  73. <service id="baz" class="Baz">
  74. <call method="setFoo">
  75. <argument type="service" id="foo_with_inline"/>
  76. </call>
  77. </service>
  78. <service id="request" class="Request" synthetic="true"/>
  79. <service id="configurator_service" class="ConfClass" public="false">
  80. <call method="setFoo">
  81. <argument type="service" id="baz"/>
  82. </call>
  83. </service>
  84. <service id="configured_service" class="stdClass">
  85. <configurator service="configurator_service" method="configureStdClass"/>
  86. </service>
  87. <service id="decorated" class="stdClass"/>
  88. <service id="decorator_service" class="stdClass" decorates="decorated"/>
  89. <service id="decorator_service_with_name" class="stdClass" decorates="decorated" decoration-inner-name="decorated.pif-pouf"/>
  90. <service id="deprecated_service" class="stdClass">
  91. <deprecated>The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.</deprecated>
  92. </service>
  93. <service id="new_factory" class="FactoryClass" public="false">
  94. <property name="foo">bar</property>
  95. </service>
  96. <service id="factory_service" class="Bar">
  97. <factory service="foo.baz" method="getInstance"/>
  98. </service>
  99. <service id="new_factory_service" class="FooBarBaz">
  100. <property name="foo">bar</property>
  101. <factory service="new_factory" method="getInstance"/>
  102. </service>
  103. <service id="service_from_static_method" class="Bar\FooClass">
  104. <factory class="Bar\FooClass" method="getInstance"/>
  105. </service>
  106. <service id="alias_for_foo" alias="foo"/>
  107. <service id="alias_for_alias" alias="foo"/>
  108. </services>
  109. </container>