SchemaLocator.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Cron\Model\Groups\Config;
  7. use Magento\Framework\Module\Dir;
  8. /**
  9. * Cron locator
  10. */
  11. class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
  12. {
  13. /**
  14. * Path to corresponding XSD file with validation rules for merged config
  15. *
  16. * @var string
  17. */
  18. protected $_schema;
  19. /**
  20. * Path to corresponding XSD file with validation rules for separate config files
  21. *
  22. * @var string
  23. */
  24. protected $_perFileSchema;
  25. /**
  26. * @param \Magento\Framework\Module\Dir\Reader $moduleReader
  27. */
  28. public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader)
  29. {
  30. $this->_schema = $moduleReader->getModuleDir(Dir::MODULE_ETC_DIR, 'Magento_Cron') . '/' . 'cron_groups.xsd';
  31. $this->_perFileSchema = $this->_schema;
  32. }
  33. /**
  34. * Get path to merged config schema
  35. *
  36. * @return string|null
  37. */
  38. public function getSchema()
  39. {
  40. return $this->_schema;
  41. }
  42. /**
  43. * Get path to pre file validation schema
  44. *
  45. * @return string|null
  46. */
  47. public function getPerFileSchema()
  48. {
  49. return $this->_perFileSchema;
  50. }
  51. }