services-1.0.xsd 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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:element name="stack" type="stack" minOccurs="0" />
  54. </xsd:choice>
  55. </xsd:complexType>
  56. <xsd:complexType name="imports">
  57. <xsd:annotation>
  58. <xsd:documentation><![CDATA[
  59. Enclosing element for the import elements
  60. ]]></xsd:documentation>
  61. </xsd:annotation>
  62. <xsd:choice minOccurs="1" maxOccurs="unbounded">
  63. <xsd:element name="import" type="import" />
  64. </xsd:choice>
  65. </xsd:complexType>
  66. <xsd:complexType name="import">
  67. <xsd:annotation>
  68. <xsd:documentation><![CDATA[
  69. Import an external resource defining other services or parameters
  70. ]]></xsd:documentation>
  71. </xsd:annotation>
  72. <xsd:attribute name="resource" type="xsd:string" use="required" />
  73. <xsd:attribute name="ignore-errors" type="ignore_errors" />
  74. <xsd:attribute name="type" type="xsd:string" />
  75. </xsd:complexType>
  76. <xsd:complexType name="callable">
  77. <xsd:choice minOccurs="0" maxOccurs="1">
  78. <xsd:element name="service" type="service" minOccurs="0" maxOccurs="1" />
  79. </xsd:choice>
  80. <xsd:attribute name="service" type="xsd:string" />
  81. <xsd:attribute name="class" type="xsd:string" />
  82. <xsd:attribute name="method" type="xsd:string" />
  83. <xsd:attribute name="function" type="xsd:string" />
  84. </xsd:complexType>
  85. <xsd:complexType name="defaults">
  86. <xsd:annotation>
  87. <xsd:documentation><![CDATA[
  88. Enclosing element for the service definitions' defaults for the current file
  89. ]]></xsd:documentation>
  90. </xsd:annotation>
  91. <xsd:choice maxOccurs="unbounded">
  92. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  93. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  94. </xsd:choice>
  95. <xsd:attribute name="public" type="boolean" />
  96. <xsd:attribute name="autowire" type="boolean" />
  97. <xsd:attribute name="autoconfigure" type="boolean" />
  98. </xsd:complexType>
  99. <xsd:complexType name="service">
  100. <xsd:choice maxOccurs="unbounded">
  101. <xsd:element name="file" type="xsd:string" minOccurs="0" maxOccurs="1" />
  102. <xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
  103. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  104. <xsd:element name="factory" type="callable" minOccurs="0" maxOccurs="1" />
  105. <xsd:element name="deprecated" type="deprecated" minOccurs="0" maxOccurs="1" />
  106. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  107. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  108. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  109. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  110. </xsd:choice>
  111. <xsd:attribute name="id" type="xsd:string" />
  112. <xsd:attribute name="class" type="xsd:string" />
  113. <xsd:attribute name="shared" type="boolean" />
  114. <xsd:attribute name="public" type="boolean" />
  115. <xsd:attribute name="synthetic" type="boolean" />
  116. <xsd:attribute name="lazy" type="xsd:string" />
  117. <xsd:attribute name="abstract" type="boolean" />
  118. <xsd:attribute name="alias" type="xsd:string" />
  119. <xsd:attribute name="parent" type="xsd:string" />
  120. <xsd:attribute name="decorates" type="xsd:string" />
  121. <xsd:attribute name="decoration-on-invalid" type="invalid_decorated_service_sequence" />
  122. <xsd:attribute name="decoration-inner-name" type="xsd:string" />
  123. <xsd:attribute name="decoration-priority" type="xsd:integer" />
  124. <xsd:attribute name="autowire" type="boolean" />
  125. <xsd:attribute name="autoconfigure" type="boolean" />
  126. </xsd:complexType>
  127. <xsd:complexType name="instanceof">
  128. <xsd:choice maxOccurs="unbounded">
  129. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  130. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  131. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  132. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  133. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  134. </xsd:choice>
  135. <xsd:attribute name="id" type="xsd:string" use="required" />
  136. <xsd:attribute name="shared" type="boolean" />
  137. <xsd:attribute name="public" type="boolean" />
  138. <xsd:attribute name="lazy" type="xsd:string" />
  139. <xsd:attribute name="autowire" type="boolean" />
  140. <xsd:attribute name="autoconfigure" type="boolean" />
  141. </xsd:complexType>
  142. <xsd:complexType name="prototype">
  143. <xsd:choice maxOccurs="unbounded">
  144. <xsd:element name="argument" type="argument" minOccurs="0" maxOccurs="unbounded" />
  145. <xsd:element name="configurator" type="callable" minOccurs="0" maxOccurs="1" />
  146. <xsd:element name="factory" type="callable" minOccurs="0" maxOccurs="1" />
  147. <xsd:element name="deprecated" type="deprecated" minOccurs="0" maxOccurs="1" />
  148. <xsd:element name="call" type="call" minOccurs="0" maxOccurs="unbounded" />
  149. <xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
  150. <xsd:element name="property" type="property" minOccurs="0" maxOccurs="unbounded" />
  151. <xsd:element name="bind" type="bind" minOccurs="0" maxOccurs="unbounded" />
  152. <xsd:element name="exclude" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
  153. </xsd:choice>
  154. <xsd:attribute name="namespace" type="xsd:string" use="required" />
  155. <xsd:attribute name="resource" type="xsd:string" use="required" />
  156. <xsd:attribute name="exclude" type="xsd:string" />
  157. <xsd:attribute name="shared" type="boolean" />
  158. <xsd:attribute name="public" type="boolean" />
  159. <xsd:attribute name="lazy" type="xsd:string" />
  160. <xsd:attribute name="abstract" type="boolean" />
  161. <xsd:attribute name="parent" type="xsd:string" />
  162. <xsd:attribute name="autowire" type="boolean" />
  163. <xsd:attribute name="autoconfigure" type="boolean" />
  164. </xsd:complexType>
  165. <xsd:complexType name="stack">
  166. <xsd:choice maxOccurs="unbounded">
  167. <xsd:element name="service" type="service" minOccurs="1" />
  168. <xsd:element name="deprecated" type="deprecated" minOccurs="0" maxOccurs="1" />
  169. </xsd:choice>
  170. <xsd:attribute name="id" type="xsd:string" use="required" />
  171. <xsd:attribute name="public" type="boolean" />
  172. </xsd:complexType>
  173. <xsd:complexType name="tag">
  174. <xsd:simpleContent>
  175. <xsd:extension base="xsd:string">
  176. <xsd:anyAttribute namespace="##any" processContents="lax" />
  177. </xsd:extension>
  178. </xsd:simpleContent>
  179. </xsd:complexType>
  180. <xsd:complexType name="deprecated">
  181. <xsd:simpleContent>
  182. <xsd:extension base="xsd:string">
  183. <!-- In Symfony 6, make these attributes required -->
  184. <xsd:attribute name="package" type="xsd:string" />
  185. <xsd:attribute name="version" type="xsd:string" />
  186. </xsd:extension>
  187. </xsd:simpleContent>
  188. </xsd:complexType>
  189. <xsd:complexType name="parameters">
  190. <xsd:choice minOccurs="1" maxOccurs="unbounded">
  191. <xsd:element name="parameter" type="parameter" />
  192. </xsd:choice>
  193. <xsd:attribute name="type" type="parameter_type" />
  194. <xsd:attribute name="key" type="xsd:string" />
  195. </xsd:complexType>
  196. <xsd:complexType name="parameter" mixed="true">
  197. <xsd:choice minOccurs="0" maxOccurs="unbounded">
  198. <xsd:element name="parameter" type="parameter" />
  199. </xsd:choice>
  200. <xsd:attribute name="type" type="parameter_type" />
  201. <xsd:attribute name="id" type="xsd:string" />
  202. <xsd:attribute name="key" type="xsd:string" />
  203. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  204. </xsd:complexType>
  205. <xsd:complexType name="property" mixed="true">
  206. <xsd:choice minOccurs="0">
  207. <xsd:element name="property" type="property" maxOccurs="unbounded" />
  208. <xsd:element name="service" type="service" />
  209. </xsd:choice>
  210. <xsd:attribute name="type" type="argument_type" />
  211. <xsd:attribute name="id" type="xsd:string" />
  212. <xsd:attribute name="key" type="xsd:string" />
  213. <xsd:attribute name="name" type="xsd:string" />
  214. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  215. <xsd:attribute name="tag" type="xsd:string" />
  216. </xsd:complexType>
  217. <xsd:complexType name="bind" mixed="true">
  218. <xsd:choice maxOccurs="unbounded">
  219. <xsd:element name="bind" type="argument" minOccurs="0" maxOccurs="unbounded" />
  220. <xsd:element name="service" type="service" />
  221. </xsd:choice>
  222. <xsd:attribute name="type" type="argument_type" />
  223. <xsd:attribute name="id" type="xsd:string" />
  224. <xsd:attribute name="key" type="xsd:string" use="required" />
  225. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  226. <xsd:attribute name="method" type="xsd:string" />
  227. <xsd:attribute name="tag" type="xsd:string" />
  228. </xsd:complexType>
  229. <xsd:complexType name="argument" mixed="true">
  230. <xsd:choice minOccurs="0">
  231. <xsd:element name="argument" type="argument" maxOccurs="unbounded" />
  232. <xsd:element name="service" type="service" />
  233. </xsd:choice>
  234. <xsd:attribute name="type" type="argument_type" />
  235. <xsd:attribute name="id" type="xsd:string" />
  236. <xsd:attribute name="key" type="xsd:string" />
  237. <xsd:attribute name="index" type="xsd:integer" />
  238. <xsd:attribute name="on-invalid" type="invalid_sequence" />
  239. <xsd:attribute name="tag" type="xsd:string" />
  240. <xsd:attribute name="index-by" type="xsd:string" />
  241. <xsd:attribute name="default-index-method" type="xsd:string" />
  242. <xsd:attribute name="default-priority-method" type="xsd:string" />
  243. </xsd:complexType>
  244. <xsd:complexType name="call">
  245. <xsd:choice minOccurs="0">
  246. <xsd:element name="argument" type="argument" maxOccurs="unbounded" />
  247. </xsd:choice>
  248. <xsd:attribute name="method" type="xsd:string" />
  249. <xsd:attribute name="returns-clone" type="boolean" />
  250. </xsd:complexType>
  251. <xsd:simpleType name="parameter_type">
  252. <xsd:restriction base="xsd:string">
  253. <xsd:enumeration value="collection" />
  254. <xsd:enumeration value="string" />
  255. <xsd:enumeration value="constant" />
  256. <xsd:enumeration value="binary" />
  257. </xsd:restriction>
  258. </xsd:simpleType>
  259. <xsd:simpleType name="argument_type">
  260. <xsd:restriction base="xsd:string">
  261. <xsd:enumeration value="abstract" />
  262. <xsd:enumeration value="collection" />
  263. <xsd:enumeration value="service" />
  264. <xsd:enumeration value="expression" />
  265. <xsd:enumeration value="string" />
  266. <xsd:enumeration value="constant" />
  267. <xsd:enumeration value="binary" />
  268. <xsd:enumeration value="iterator" />
  269. <xsd:enumeration value="service_locator" />
  270. <!-- "tagged" is an alias of "tagged_iterator", using "tagged_iterator" is preferred. -->
  271. <xsd:enumeration value="tagged" />
  272. <xsd:enumeration value="tagged_iterator" />
  273. <xsd:enumeration value="tagged_locator" />
  274. </xsd:restriction>
  275. </xsd:simpleType>
  276. <xsd:simpleType name="ignore_errors">
  277. <xsd:restriction base="xsd:string">
  278. <xsd:pattern value="(true|false|not_found)" />
  279. </xsd:restriction>
  280. </xsd:simpleType>
  281. <xsd:simpleType name="invalid_sequence">
  282. <xsd:restriction base="xsd:string">
  283. <xsd:enumeration value="null" />
  284. <xsd:enumeration value="ignore" />
  285. <xsd:enumeration value="exception" />
  286. <xsd:enumeration value="ignore_uninitialized" />
  287. </xsd:restriction>
  288. </xsd:simpleType>
  289. <xsd:simpleType name="invalid_decorated_service_sequence">
  290. <xsd:restriction base="xsd:string">
  291. <xsd:enumeration value="null" />
  292. <xsd:enumeration value="ignore" />
  293. <xsd:enumeration value="exception" />
  294. </xsd:restriction>
  295. </xsd:simpleType>
  296. <xsd:simpleType name="boolean">
  297. <xsd:restriction base="xsd:string">
  298. <xsd:pattern value="(%.+%|true|false)" />
  299. </xsd:restriction>
  300. </xsd:simpleType>
  301. </xsd:schema>