services9.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" ?>
  2. <container xmlns="http://symfony-project.org/2.0/container">
  3. <parameters>
  4. <parameter key="baz_class">BazClass</parameter>
  5. <parameter key="foo_class">FooClass</parameter>
  6. <parameter key="foo">bar</parameter>
  7. <parameter key="foo_bar" type="service" id="foo_bar" />
  8. </parameters>
  9. <services>
  10. <service id="foo" class="FooClass" constructor="getInstance" shared="false">
  11. <file>%path%/foo.php</file>
  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="bar">%foo%</argument>
  17. </argument>
  18. <argument>true</argument>
  19. <argument type="service" id="service_container" />
  20. <call method="setBar">
  21. <argument>bar</argument>
  22. </call>
  23. <call method="initialize" />
  24. <configurator function="sc_configure" />
  25. </service>
  26. <service id="bar" class="FooClass">
  27. <argument>foo</argument>
  28. <argument type="service" id="foo.baz" />
  29. <argument>%foo_bar%</argument>
  30. <configurator service="foo.baz" method="configure" />
  31. </service>
  32. <service id="foo.baz" class="%baz_class%" constructor="getInstance">
  33. <configurator class="%baz_class%" method="configureStatic1" />
  34. </service>
  35. <service id="foo_bar" class="%foo_class%">
  36. </service>
  37. <service id="method_call1" class="FooClass">
  38. <call method="setBar">
  39. <argument type="service" id="foo" />
  40. </call>
  41. <call method="setBar">
  42. <argument type="service" id="foo" on-invalid="null" />
  43. </call>
  44. <call method="setBar">
  45. <argument type="service" id="foo" on-invalid="ignore" />
  46. </call>
  47. <call method="setBar">
  48. <argument type="service" id="foobaz" on-invalid="ignore" />
  49. </call>
  50. </service>
  51. <service id="alias_for_foo" alias="foo" />
  52. </services>
  53. </container>