SchemaLocator.php 1.1 KB

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