services9.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. <parameter key="foo_bar" type="service" id="foo_bar" />
  10. </parameters>
  11. <services>
  12. <service id="foo" class="FooClass" constructor="getInstance" shared="false">
  13. <file>%path%/foo.php</file>
  14. <argument>foo</argument>
  15. <argument type="service" id="foo.baz" />
  16. <argument type="collection">
  17. <argument key="%foo%">foo is %foo%</argument>
  18. <argument key="bar">%foo%</argument>
  19. </argument>
  20. <argument>true</argument>
  21. <argument type="service" id="service_container" />
  22. <call method="setBar">
  23. <argument>bar</argument>
  24. </call>
  25. <call method="initialize" />
  26. <configurator function="sc_configure" />
  27. </service>
  28. <service id="bar" class="FooClass">
  29. <argument>foo</argument>
  30. <argument type="service" id="foo.baz" />
  31. <argument>%foo_bar%</argument>
  32. <configurator service="foo.baz" method="configure" />
  33. </service>
  34. <service id="foo.baz" class="%baz_class%" constructor="getInstance">
  35. <configurator class="%baz_class%" method="configureStatic1" />
  36. </service>
  37. <service id="foo_bar" class="%foo_class%">
  38. </service>
  39. <service id="method_call1" class="FooClass">
  40. <call method="setBar">
  41. <argument type="service" id="foo" />
  42. </call>
  43. <call method="setBar">
  44. <argument type="service" id="foo" on-invalid="null" />
  45. </call>
  46. <call method="setBar">
  47. <argument type="service" id="foo" on-invalid="ignore" />
  48. </call>
  49. <call method="setBar">
  50. <argument type="service" id="foobaz" on-invalid="ignore" />
  51. </call>
  52. </service>
  53. <service id="alias_for_foo" alias="foo" />
  54. </services>
  55. </container>