Class FileResolver @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 22 of file FileResolver.php.
◆ __construct()
- Parameters
-
DirReader | $moduleReader | |
FileIteratorFactory | $iteratorFactory | |
DesignInterface | $designInterface | |
DirectoryList | $directoryList | |
- Deprecated:
- Parameters
-
Definition at line 70 of file FileResolver.php.
78 $this->directoryList = $directoryList;
81 $this->currentTheme = $designInterface->getDesignTheme();
82 $this->area = $designInterface->getArea();
◆ get()
get |
( |
|
$filename, |
|
|
|
$scope |
|
) |
| |
{Retrieve the list of configuration files with given name that relate to specified scope
- Parameters
-
string | $filename | |
string | $scope | |
- Returns
- array
}
Implements FileResolverInterface.
Definition at line 90 of file FileResolver.php.
94 $iterator = $this->moduleReader->getConfigurationFiles($filename)->toArray();
95 $themeConfigFile = $this->currentTheme->getCustomization()->getCustomViewConfigPath();
97 && $this->rootDirectory->isExist($this->rootDirectory->getRelativePath($themeConfigFile))
99 $iterator[$this->rootDirectory->getRelativePath($themeConfigFile)] =
100 $this->rootDirectory->readFile(
101 $this->rootDirectory->getRelativePath(
106 $designPath = $this->resolver->resolve(
112 if (file_exists($designPath)) {
114 $designDom = new \DOMDocument();
115 $designDom->load($designPath);
116 $iterator[$designPath] = $designDom->saveXML();
117 }
catch (\Exception $e) {
118 throw new \Magento\Framework\Exception\LocalizedException(
119 new \
Magento\Framework\Phrase(
'Could not read config file')
126 $iterator = $this->iteratorFactory->create([]);
◆ getParents()
getParents |
( |
|
$filename, |
|
|
|
$scope |
|
) |
| |
{Retrieve parent configs
- Parameters
-
string | $filename | |
string | $scope | |
- Returns
- array
- Since
- 100.1.0
}
Implements DesignResolverInterface.
Definition at line 135 of file FileResolver.php.
139 $iterator = $this->moduleReader->getConfigurationFiles($filename)->toArray();
140 $designPath = $this->resolver->resolve(
147 if (file_exists($designPath)) {
149 $iterator = $this->getParentConfigs($this->currentTheme, []);
150 }
catch (\Exception $e) {
151 throw new \Magento\Framework\Exception\LocalizedException(
152 new \
Magento\Framework\Phrase(
'Could not read config file')
158 $iterator = $this->iteratorFactory->create([]);
◆ $area
◆ $currentTheme
◆ $iteratorFactory
◆ $moduleReader
◆ $resolver
◆ $rootDirectory
The documentation for this class was generated from the following file: