QuestionQ1

Customize Commerce features

Within a custom module, an Architect needs to define a new XML configuration file. The module must be able to read every XML configuration file declared in the system, merge them, and use their values in a PHP class.

Which two steps should the Architect take to satisfy this requirement?

Choose two
  • A Inject a “reader” dependency for “Magento\Framework\Config\Data” in di.xml
  • B Write a plugin for \Magento\Framework\Config\Data::get() and read the custom xml files
  • C Create a Data class that implements “\Magento\Framework\Config\Data”
  • D Append the custom xml file name in “Magento\Config\Model\Config\Structure\Reader” in di.xml
  • E Make a Reader class that implements “\Magento\Framework\Config\Reader\Filesystem”
Explanation

Magento’s configuration framework uses a filesystem-based configuration reader to collect and merge a named XML configuration file from registered modules. Magento\Framework\Config\Data consumes that reader through dependency injection and provides the merged configuration values to PHP code. The system-configuration structure reader is for Admin configuration metadata, not a general custom XML configuration format. Commerce framework

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!