services9.xml 2.0 KB

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