validator.xml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" ?>
  2. <container xmlns="http://symfony.com/schema/dic/services"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
  5. <parameters>
  6. <parameter key="validator.class">Symfony\Component\Validator\Validator\ValidatorInterface</parameter>
  7. <parameter key="validator.builder.class">Symfony\Component\Validator\ValidatorBuilderInterface</parameter>
  8. <parameter key="validator.builder.factory.class">Symfony\Component\Validator\Validation</parameter>
  9. <parameter key="validator.mapping.cache.apc.class">Symfony\Component\Validator\Mapping\Cache\ApcCache</parameter>
  10. <parameter key="validator.mapping.cache.prefix" />
  11. <parameter key="validator.validator_factory.class">Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory</parameter>
  12. <parameter key="validator.expression.class">Symfony\Component\Validator\Constraints\ExpressionValidator</parameter>
  13. <parameter key="validator.email.class">Symfony\Component\Validator\Constraints\EmailValidator</parameter>
  14. </parameters>
  15. <services>
  16. <service id="validator" class="%validator.class%">
  17. <factory service="validator.builder" method="getValidator" />
  18. </service>
  19. <service id="validator.builder" class="%validator.builder.class%">
  20. <factory class="%validator.builder.factory.class%" method="createValidatorBuilder" />
  21. <call method="setConstraintValidatorFactory">
  22. <argument type="service" id="validator.validator_factory" />
  23. </call>
  24. <call method="setTranslator">
  25. <argument type="service" id="translator" />
  26. </call>
  27. <call method="setTranslationDomain">
  28. <argument>%validator.translation_domain%</argument>
  29. </call>
  30. </service>
  31. <service id="validator.mapping.class_metadata_factory" alias="validator" public="false" />
  32. <service id="validator.mapping.cache.apc" class="%validator.mapping.cache.apc.class%" public="false">
  33. <argument>%validator.mapping.cache.prefix%</argument>
  34. <deprecated>The "%service_id%" service is deprecated since Symfony 2.5 and will be removed in 3.0.</deprecated>
  35. </service>
  36. <service id="validator.mapping.cache.doctrine.apc" class="Symfony\Component\Validator\Mapping\Cache\DoctrineCache" public="false">
  37. <argument type="service">
  38. <service class="Doctrine\Common\Cache\ApcCache">
  39. <call method="setNamespace">
  40. <argument>%validator.mapping.cache.prefix%</argument>
  41. </call>
  42. </service>
  43. </argument>
  44. </service>
  45. <service id="validator.validator_factory" class="%validator.validator_factory.class%" public="false">
  46. <argument type="service" id="service_container" />
  47. <argument type="collection" />
  48. </service>
  49. <service id="validator.expression" class="%validator.expression.class%">
  50. <argument type="service" id="property_accessor" />
  51. <tag name="validator.constraint_validator" alias="validator.expression" />
  52. </service>
  53. <service id="validator.email" class="%validator.email.class%">
  54. <argument></argument>
  55. <tag name="validator.constraint_validator" alias="Symfony\Component\Validator\Constraints\EmailValidator" />
  56. </service>
  57. </services>
  58. </container>