SchemaLocator.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue\Consumer\Config\Xml;
  7. /**
  8. * Schema locator for etc/queue_consumer.xml
  9. */
  10. class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
  11. {
  12. /**
  13. * Path to corresponding XSD file with validation rules for merged config
  14. *
  15. * @var string
  16. */
  17. protected $schema;
  18. /**
  19. * Path to corresponding XSD file with validation rules for separate config files
  20. *
  21. * @var string
  22. */
  23. protected $perFileSchema;
  24. /**
  25. * Initialize dependencies.
  26. *
  27. * @param \Magento\Framework\Config\Dom\UrnResolver $urnResolver
  28. */
  29. public function __construct(\Magento\Framework\Config\Dom\UrnResolver $urnResolver)
  30. {
  31. $this->schema = $urnResolver->getRealPath('urn:magento:framework-message-queue:etc/consumer.xsd');
  32. $this->perFileSchema = $urnResolver->getRealPath('urn:magento:framework-message-queue:etc/consumer.xsd');
  33. }
  34. /**
  35. * Get path to merged config schema
  36. *
  37. * @return string|null
  38. */
  39. public function getSchema()
  40. {
  41. return $this->schema;
  42. }
  43. /**
  44. * Get path to per file validation schema
  45. *
  46. * @return string|null
  47. */
  48. public function getPerFileSchema()
  49. {
  50. return $this->perFileSchema;
  51. }
  52. }