Reader.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * Routes configuration reader
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\App\Route\Config;
  9. class Reader extends \Magento\Framework\Config\Reader\Filesystem
  10. {
  11. /**
  12. * List of paths to identifiable nodes
  13. *
  14. * @var array
  15. */
  16. protected $_idAttributes = [
  17. '/config/router' => 'id',
  18. '/config/router/route' => 'id',
  19. '/config/router/route/module' => 'name',
  20. ];
  21. /**
  22. * @param \Magento\Framework\Config\FileResolverInterface $fileResolver
  23. * @param Converter $converter
  24. * @param SchemaLocator $schemaLocator
  25. * @param \Magento\Framework\Config\ValidationStateInterface $validationState
  26. * @param string $fileName
  27. */
  28. public function __construct(
  29. \Magento\Framework\Config\FileResolverInterface $fileResolver,
  30. Converter $converter,
  31. SchemaLocator $schemaLocator,
  32. \Magento\Framework\Config\ValidationStateInterface $validationState,
  33. $fileName = 'routes.xml'
  34. ) {
  35. parent::__construct(
  36. $fileResolver,
  37. $converter,
  38. $schemaLocator,
  39. $validationState,
  40. $fileName,
  41. $this->_idAttributes
  42. );
  43. }
  44. }