Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
FileResolverStub Class Reference
Inheritance diagram for FileResolverStub:
FileResolverInterface

Public Member Functions

 __construct (\Magento\Framework\Module\Dir\Reader $moduleReader, array $files=[])
 
 get ($filename, $scope)
 

Detailed Description

Definition at line 14 of file FileResolverStub.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Module\Dir\Reader  $moduleReader,
array  $files = [] 
)

FileResolverStub constructor.

Parameters
\Magento\Framework\Module\Dir\Reader$moduleReader
array$files

Definition at line 52 of file FileResolverStub.php.

53  {
54  $this->files = array_replace($this->files, $files);
55  $this->moduleReader = $moduleReader;
56  }
foreach($appDirs as $dir) $files

Member Function Documentation

◆ 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 61 of file FileResolverStub.php.

62  {
63  if ($filename == 'etc/definition.map.xml') {
64  $path = $this->moduleReader->getModuleDir(Dir::MODULE_VIEW_DIR, 'Magento_Ui') . '/base';
65  } else {
66  $path = realpath(__DIR__ . '/../_files/view');
67  }
68  $files = isset($this->files[$filename]) ? $this->files[$filename] : [];
69  $realPaths = [];
70  foreach ($files as $filePath) {
71  $realPaths[] = $path . '/' . $filePath;
72  }
73  return new FileIterator(new ReadFactory(new DriverPool), $realPaths);
74  }
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60
foreach($appDirs as $dir) $files

The documentation for this class was generated from the following file: