27 private $pathPatternHelper;
41 private $readDirFactory;
48 private $componentRegistrar;
67 FileFactory $fileFactory,
73 $this->pathPatternHelper = $pathPatternHelper;
74 $this->fileFactory = $fileFactory;
75 $this->readDirFactory = $readDirFactory;
77 $this->subDir = $subDir ? $subDir .
'/' :
'';
90 $themePath =
$theme->getFullPath();
91 if (empty($themePath)) {
94 $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath);
95 if (!$themeAbsolutePath) {
98 $themeDir = $this->readDirFactory->create($themeAbsolutePath);
99 $searchPattern =
"{$namespace}_{$module}/{$this->subDir}{$filePath}";
100 $files = $themeDir->search($searchPattern);
102 $pattern =
"#(?<moduleName>[^/]+)/{$this->subDir}" 103 . $this->pathPatternHelper->translatePatternFromGlob($filePath) .
"$#i";
104 foreach (
$files as $file) {
105 $filename = $themeDir->getAbsolutePath($file);
__construct(FileFactory $fileFactory, ReadFactory $readDirFactory, ComponentRegistrarInterface $componentRegistrar, PathPattern $pathPatternHelper, $subDir='')
getFiles(ThemeInterface $theme, $filePath)
foreach($appDirs as $dir) $files