ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 16 - AD0-E718 discussion

Report
Export

In a custom module, an Architect wants to define a new xml configuration file. The module should be able to read all the xml configuration files declared in the system, merge them together, and use their values in PHP class.

Which two steps should the Architect make to meet this requirement? (Choose two.)

A.
Write a plugin for \Magento\Framework\Config\Data::get() and read the custom xml files
Answers
A.
Write a plugin for \Magento\Framework\Config\Data::get() and read the custom xml files
B.
Append the custom xml file name in "Magento\Config\Model\Config\Structure\Reader" in di.xml
Answers
B.
Append the custom xml file name in "Magento\Config\Model\Config\Structure\Reader" in di.xml
C.
Create a Data class that implements "\Magento\Framework\Config\Data'
Answers
C.
Create a Data class that implements "\Magento\Framework\Config\Data'
D.
Inject a "reader" dependency for "Magento\Framework\Config\Data" in di.xml
Answers
D.
Inject a "reader" dependency for "Magento\Framework\Config\Data" in di.xml
E.
Make a Reader class that implements "\Magento\Framework\Config\Reader\Filesystem"
Answers
E.
Make a Reader class that implements "\Magento\Framework\Config\Reader\Filesystem"
Suggested answer: C, E

Explanation:

Based on web searches, it seems that Magento uses different classes and interfaces to interact with configuration files, such as Data, Reader, and Converter12.

According to the documentation1, Data is a class that provides access to configuration data using a scope. Reader is an interface that reads configuration data from XML files. Converter is an interface that converts XML data into an array representation.

Based on these definitions, I would say that two possible steps that the Architect should make to meet the requirement are:

1. Create a Data class that implements “\Magento\Framework\Config\Data”

2. Make a Reader class that implements “\Magento\Framework\Config\Reader\Filesystem” These steps would allow the custom module to read all the XML configuration files declared in the system, merge them together, and use their values in PHP class.

asked 02/10/2024
Bernardo Garcia
43 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first