Skip to content

Commit 6ac4153

Browse files
Rollback removal of _parseModuleStatic()
1 parent d562df9 commit 6ac4153

File tree

1 file changed

+25
-1
lines changed
  • lib/internal/Magento/Framework/App/Utility

1 file changed

+25
-1
lines changed

lib/internal/Magento/Framework/App/Utility/Files.php

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,30 @@ protected function _accumulateFilesByPatterns(array $patterns, $filePattern, arr
10381038
}
10391039
}
10401040

1041+
/**
1042+
* Parse meta-info of a static file in module
1043+
*
1044+
* @deprecated Replaced with method _accumulateStaticFiles()
1045+
*
1046+
* @param string $file
1047+
* @return array
1048+
*/
1049+
protected function _parseModuleStatic($file)
1050+
{
1051+
foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $modulePath) {
1052+
if (preg_match(
1053+
'/^' . preg_quote("{$modulePath}/", '/') . 'view\/([a-z]+)\/web\/(.+)$/i',
1054+
$file,
1055+
$matches
1056+
) === 1
1057+
) {
1058+
list(, $area, $filePath) = $matches;
1059+
return [$area, '', '', $moduleName, $filePath, $file];
1060+
}
1061+
}
1062+
return [];
1063+
}
1064+
10411065
/**
10421066
* Search static files from all modules by the specified pattern and accumulate meta-info
10431067
*
@@ -1046,7 +1070,7 @@ protected function _accumulateFilesByPatterns(array $patterns, $filePattern, arr
10461070
* @param array $result
10471071
* @return void
10481072
*/
1049-
protected function _accumulateStaticFiles($area, $filePattern, array &$result)
1073+
private function _accumulateStaticFiles($area, $filePattern, array &$result)
10501074
{
10511075
foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleName => $moduleDir) {
10521076
$moduleWebPath = $moduleDir . "/view/{$area}/web";

0 commit comments

Comments
 (0)