24 private $pathPatternHelper;
34 private $readDirFactory;
39 private $componentRegistrar;
56 FileFactory $fileFactory,
62 $this->pathPatternHelper = $pathPatternHelper;
63 $this->fileFactory = $fileFactory;
64 $this->readDirFactory = $readDirFactory;
66 $this->subDir = $subDir ? $subDir .
'/' :
'';
79 $themePath =
$theme->getFullPath();
80 if (empty($themePath)) {
83 $themeAbsolutePath = $this->componentRegistrar->getPath(ComponentRegistrar::THEME, $themePath);
84 if (!$themeAbsolutePath) {
87 $themeDir = $this->readDirFactory->create($themeAbsolutePath);
88 $files = $themeDir->search(
"{$namespace}_{$module}/{$this->subDir}$filePath");
90 $pattern =
"#/(?<moduleName>[^/]+)/{$this->subDir}" 91 . $this->pathPatternHelper->translatePatternFromGlob($filePath) .
"$#i";
92 foreach (
$files as $file) {
93 $filename = $themeDir->getAbsolutePath($file);
getFiles(ThemeInterface $theme, $filePath)
foreach($appDirs as $dir) $files
__construct(FileFactory $fileFactory, ReadFactory $readDirFactory, ComponentRegistrarInterface $componentRegistrar, PathPattern $pathPatternHelper, $subDir='')