services-1.0.xsd 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <xsd:schema xmlns="http://symfony.com/schema/dic/services"
  3. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  4. targetNamespace="http://symfony.com/schema/dic/services"
  5. elementFormDefault="qualified">
  6. <xsd:annotation>
  7. <xsd:documentation><![CDATA[
  8. Symfony XML Services Schema, version 1.0
  9. Authors: Fabien Potencier
  10. This defines a way to describe PHP objects (services) and their
  11. dependencies.
  12. ]]></xsd:documentation>
  13. </xsd:annotation>
  14. <xsd:element name="container" type="container" />
  15. <xsd:complexType name="container">
  16. <xsd:annotation>
  17. <xsd:documentation><![CDATA[
  18. The root element of a service file.
  19. ]]></xsd:documentation>
  20. </xsd:annotation>
  21. <xsd:sequence>
  22. <xsd:group ref="foreign" />
  23. <xsd:sequence minOccurs="0">
  24. <xsd:element name="imports" type="imports" />
  25. <xsd:group ref="foreign" />
  26. </xsd:sequence>
  27. <xsd:sequence minOccurs="0">
  28. <xsd:element name="parameters" type="parameters" />
  29. <xsd:group ref="foreign" />
  30. </xsd:sequence>
  31. <xsd:sequence minOccurs="0">
  32. <xsd:element name="services" type="services" />
  33. <xsd:group ref="foreign" />
  34. </xsd:sequence>
  35. </xsd:sequence>
  36. </xsd:complexType>
  37. <xsd:group name="foreign">
  38. <xsd:sequence>
  39. <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
  40. </xsd:sequence>
  41. </xsd:group>
  42. <xsd:complexType name="services">
  43. <xsd:annotation>
  44. <xsd:documentation><![CDATA[
  45. Enclosing element for the definition of all services
  46. ]]></xsd:documentation>
  47. </xsd:annotation>
  48. <xsd:choice maxOccurs="unbounded">
  49. <xsd:element name="service" type="service" minOccurs="1" />
  50. <xsd:element name="prototype" type="prototype" minOccurs="0" />
  51. <xsd:element name="defaults" type="defaults" minOccurs="0" maxOccurs="1" />
  52. <xsd:element name="instanceof" type="instanceof" minOccurs="0" />
  53. </xsd:choice>
  54. </xsd:complexType>
  55. <xsd:complexType name="imports">
  56. <xsd:annotation>
  57. <xsd:documentation><![CDATA[
  58. Enclosing element for the import elements
  59. ]]></xsd:documentation>
  60. </xsd:annotation>
  61. <xsd:choice minOccurs="1" maxOccurs="unbounded">
  62. <xsd:element name="import" type="import" />
  63. </xsd:choice>
  64. </xsd:complexType>
  65. <xsd:complexType name="import">
  66. <xsd:annotation>
  67. <xsd:documentation><![CDATA[
  68. Import an external resource defining other services or parameters
  69. ]]></xsd:documentation>
  70. </xsd:annotation>
  71. <xsd:attribute name="resource" type="xsd:string" use="required" />
  72. <xsd:attribute name="ignore-errors" type="ignore_errors" />
  73. <xsd:attribute name="type" type="xsd:string" />
  74. </xsd:complexType>
  75. <xsd:complexType name="callable">
  76. <xsd:choice minOccurs="0" maxOccurs="1">
  77. <xsd:element name="service" type="service" minOccurs="0" maxOccurs="1" />
  78. </xsd:choice>
  79. <xsd:attribute name="service" type="xsd:string" />
  80. <xsd:attribute name="class" type="xsd:string" />
  81. <xsd:attribute name="method" type="xsd:string" />
  82. <xsd:attribute name="function" type="xsd:string" />
  83. </xsd:complexType>
  84. <xsd:complexType name="defaults">
  85. <xsd:annotation>
  86. <xsd:documentation><![CDATA[
  87. Enclosing element for the service definitions' defaults for the current file
  88. ]]></xsd:documentation>
  89. </xsd:annotation>
  90. <xsd:choice maxOccurs="unbounded">
  91. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  92. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  93. </xsd:choice>
  94. <xsd:attribute name="public" type="boolean" />
  95. <xsd:attribute name="autowire" type="boolean" />
  96. <xsd:attribute name="autoconfigure" type="boolean" />
  97. </xsd:complexType>
  98. <xsd:complexType name="service">
  99. <xsd:choice maxOccurs="unbounded">
  100. <xsd:element name="file" type="xsd:string" minOccurs="0" maxOccurs="1" />
  101. <xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
  102. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  103. <xsd:element name="factory" type="callable" minOccurs="0" maxOccurs="1" />
  104. <xsd:element name="deprecated" type="xsd:string" minOccurs="0" maxOccurs="1" />
  105. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  106. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  107. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  108. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  109. </xsd:choice>
  110. <xsd:attribute name="id" type="xsd:string" />
  111. <xsd:attribute name="class" type="xsd:string" />
  112. <xsd:attribute name="shared" type="boolean" />
  113. <xsd:attribute name="public" type="boolean" />
  114. <xsd:attribute name="synthetic" type="boolean" />
  115. <xsd:attribute name="lazy" type="xsd:string" />
  116. <xsd:attribute name="abstract" type="boolean" />
  117. <xsd:attribute name="alias" type="xsd:string" />
  118. <xsd:attribute name="parent" type="xsd:string" />
  119. <xsd:attribute name="decorates" type="xsd:string" />
  120. <xsd:attribute name="decoration-on-invalid" type="invalid_decorated_service_sequence" />
  121. <xsd:attribute name="decoration-inner-name" type="xsd:string" />
  122. <xsd:attribute name="decoration-priority" type="xsd:integer" />
  123. <xsd:attribute name="autowire" type="boolean" />
  124. <xsd:attribute name="autoconfigure" type="boolean" />
  125. </xsd:complexType>
  126. <xsd:complexType name="instanceof">
  127. <xsd:choice maxOccurs="unbounded">
  128. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  129. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  130. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  131. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  132. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  133. </xsd:choice>
  134. <xsd:attribute name="id" type="xsd:string" use="required" />
  135. <xsd:attribute name="shared" type="boolean" />
  136. <xsd:attribute name="public" type="boolean" />
  137. <xsd:attribute name="lazy" type="xsd:string" />
  138. <xsd:attribute name="autowire" type="boolean" />
  139. <xsd:attribute name="autoconfigure" type="boolean" />
  140. </xsd:complexType>
  141. <xsd:complexType name="prototype">
  142. <xsd:choice maxOccurs="unbounded">
  143. <xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
  144. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  145. <xsd:element name="factory" type="callable" minOccurs="0" maxOccurs="1" />
  146. <xsd:element name="deprecated" type="xsd:string" minOccurs="0" maxOccurs="1" />
  147. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  148. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  149. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  150. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  151. <xsd:element name="exclude" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
  152. </xsd:choice>
  153. <xsd:attribute name="namespace" type="xsd:string" use="required" />
  154. <xsd:attribute name="resource" type="xsd:string" use="required" />
  155. <xsd:attribute name="exclude" type="xsd:string" />
  156. <xsd:attribute name="shared" type="boolean" />
  157. <xsd:attribute name="public" type="boolean" />
  158. <xsd:attribute name="lazy" type="xsd:string" />
  159. <xsd:attribute name="abstract" type="boolean" />
  160. <xsd:attribute name="parent" type="xsd:string" />
  161. <xsd:attribute name="autowire" type="boolean" />
  162. <xsd:attribute name="autoconfigure" type="boolean" />
  163. </xsd:complexType>
  164. <xsd:complexType name="tag">
  165. <xsd:attribute name="name" type="xsd:string" use="required" />
  166. <xsd:anyAttribute namespace="##any" processContents="lax" />
  167. </xsd:complexType>
  168. <xsd:complexType name="parameters">
  169. <xsd:choice minOccurs="1" maxOccurs="unbounded">
  170. <xsd:element name="parameter" type="parameter" />
  171. </xsd:choice>
  172. <xsd:attribute name="type" type="parameter_type" />
  173. <xsd:attribute name="key" type="xsd:string" />
  174. </xsd:complexType>
  175. <xsd:complexType name="parameter" mixed="true">
  176. <xsd:choice minOccurs="0" maxOccurs="unbounded">
  177. <xsd:element name="parameter" type="parameter" />
  178. </xsd:choice>
  179. <xsd:attribute name="type" type="parameter_type" />
  180. <xsd:attribute name="id" type="xsd:string" />
  181. <xsd:attribute name="key" type="xsd:string" />
  182. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  183. </xsd:complexType>
  184. <xsd:complexType name="property" mixed="true">
  185. <xsd:choice minOccurs="0">
  186. <xsd:element name="property" type="property" maxOccurs="unbounded" />
  187. <xsd:element name="service" type="service" />
  188. </xsd:choice>
  189. <xsd:attribute name="type" type="argument_type" />
  190. <xsd:attribute name="id" type="xsd:string" />
  191. <xsd:attribute name="key" type="xsd:string" />
  192. <xsd:attribute name="name" type="xsd:string" />
  193. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  194. <xsd:attribute name="tag" type="xsd:string" />
  195. </xsd:complexType>
  196. <xsd:complexType name="bind" mixed="true">
  197. <xsd:choice maxOccurs="unbounded">
  198. <xsd:element name="bind" type="argument" minOccurs="0" maxOccurs="unbounded" />
  199. <xsd:element name="service" type="service" />
  200. </xsd:choice>
  201. <xsd:attribute name="type" type="argument_type" />
  202. <xsd:attribute name="id" type="xsd:string" />
  203. <xsd:attribute name="key" type="xsd:string" use="required" />
  204. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  205. <xsd:attribute name="method" type="xsd:string" />
  206. <xsd:attribute name="tag" type="xsd:string" />
  207. </xsd:complexType>
  208. <xsd:complexType name="argument" mixed="true">
  209. <xsd:choice minOccurs="0">
  210. <xsd:element name="argument" type="argument" maxOccurs="unbounded" />
  211. <xsd:element name="service" type="service" />
  212. </xsd:choice>
  213. <xsd:attribute name="type" type="argument_type" />
  214. <xsd:attribute name="id" type="xsd:string" />
  215. <xsd:attribute name="key" type="xsd:string" />
  216. <xsd:attribute name="index" type="xsd:integer" />
  217. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  218. <xsd:attribute name="tag" type="xsd:string" />
  219. <xsd:attribute name="index-by" type="xsd:string" />
  220. <xsd:attribute name="default-index-method" type="xsd:string" />
  221. <xsd:attribute name="default-priority-method" type="xsd:string" />
  222. </xsd:complexType>
  223. <xsd:complexType name="call">
  224. <xsd:choice minOccurs="0">
  225. <xsd:element name="argument" type="argument" maxOccurs="unbounded" />
  226. </xsd:choice>
  227. <xsd:attribute name="method" type="xsd:string" />
  228. <xsd:attribute name="returns-clone" type="boolean" />
  229. </xsd:complexType>
  230. <xsd:simpleType name="parameter_type">
  231. <xsd:restriction base="xsd:string">
  232. <xsd:enumeration value="collection" />
  233. <xsd:enumeration value="string" />
  234. <xsd:enumeration value="constant" />
  235. <xsd:enumeration value="binary" />
  236. </xsd:restriction>
  237. </xsd:simpleType>
  238. <xsd:simpleType name="argument_type">
  239. <xsd:restriction base="xsd:string">
  240. <xsd:enumeration value="collection" />
  241. <xsd:enumeration value="service" />
  242. <xsd:enumeration value="expression" />
  243. <xsd:enumeration value="string" />
  244. <xsd:enumeration value="constant" />
  245. <xsd:enumeration value="iterator" />
  246. <xsd:enumeration value="service_locator" />
  247. <!-- "tagged" is an alias of "tagged_iterator", using "tagged_iterator" is preferred. -->
  248. <xsd:enumeration value="tagged" />
  249. <xsd:enumeration value="tagged_iterator" />
  250. <xsd:enumeration value="tagged_locator" />
  251. </xsd:restriction>
  252. </xsd:simpleType>
  253. <xsd:simpleType name="ignore_errors">
  254. <xsd:restriction base="xsd:string">
  255. <xsd:pattern value="(true|false|not_found)" />
  256. </xsd:restriction>
  257. </xsd:simpleType>
  258. <xsd:simpleType name="invalid_sequence">
  259. <xsd:restriction base="xsd:string">
  260. <xsd:enumeration value="null" />
  261. <xsd:enumeration value="ignore" />
  262. <xsd:enumeration value="exception" />
  263. <xsd:enumeration value="ignore_uninitialized" />
  264. </xsd:restriction>
  265. </xsd:simpleType>
  266. <xsd:simpleType name="invalid_decorated_service_sequence">
  267. <xsd:restriction base="xsd:string">
  268. <xsd:enumeration value="null" />
  269. <xsd:enumeration value="ignore" />
  270. <xsd:enumeration value="exception" />
  271. </xsd:restriction>
  272. </xsd:simpleType>
  273. <xsd:simpleType name="boolean">
  274. <xsd:restriction base="xsd:string">
  275. <xsd:pattern value="(%.+%|true|false)" />
  276. </xsd:restriction>
  277. </xsd:simpleType>
  278. </xsd:schema>