91     private $themePackageList;
   101     private $regexIteratorFactory;
   116         Json $serializer = 
null,
   125             ->get(RegexIteratorFactory::class);
   138         self::$_instance = $instance;
   149         if (!self::$_instance) {
   150             throw new \Exception(
'Instance is not set yet.');
   164         foreach (
$files as $file) {
   165             $key = str_replace(
BP . 
'/', 
'', $file);
   176     private function getModuleTestDirsRegex()
   178         $moduleTestDirs = [];
   180             $moduleTestDirs[] = str_replace(
'\\', 
'/', 
'#' . $moduleDir . 
'/Test#');
   182         return $moduleTestDirs;
   205             $flags = self::INCLUDE_APP_CODE
   206                 | self::INCLUDE_TESTS
   207                 | self::INCLUDE_DEV_TOOLS
   211         $key = __METHOD__ . 
BP . $flags;
   212         if (!isset(self::$_cache[$key])) {
   214                 $this->getAppCodeFiles($flags),
   215                 $this->getTestFiles($flags),
   216                 $this->getDevToolsFiles($flags),
   217                 $this->getTemplateFiles($flags),
   218                 $this->getLibraryFiles($flags),
   219                 $this->getPubFiles($flags),
   220                 $this->getSetupPhpFiles($flags)
   222             self::$_cache[$key] = 
$files;
   224         if ($flags & self::AS_DATA_SET) {
   227         return self::$_cache[$key];
   236     private function getTemplateFiles($flags)
   238         if ($flags & self::INCLUDE_TEMPLATES) {
   250     private function getLibraryFiles($flags)
   252         if ($flags & self::INCLUDE_LIBS) {
   253             $libraryExcludeDirs = [];
   255                 $libraryExcludeDirs[] = str_replace(
'\\', 
'/', 
'#' . $libraryDir . 
'/Test#');
   256                 $libraryExcludeDirs[] = str_replace(
'\\', 
'/', 
'#' . $libraryDir) . 
'/[\\w]+/Test#';
   257                 if (!($flags & self::INCLUDE_NON_CLASSES)) {
   258                     $libraryExcludeDirs[] = str_replace(
'\\', 
'/', 
'#' . $libraryDir . 
'/registration#');
   276     private function getPubFiles($flags)
   278         if ($flags & self::INCLUDE_PUB_CODE) {
   293     private function getDevToolsFiles($flags)
   295         if ($flags & self::INCLUDE_DEV_TOOLS) {
   307     private function getAppCodeFiles($flags)
   309         if ($flags & self::INCLUDE_APP_CODE) {
   312             if ($flags & self::INCLUDE_NON_CLASSES) {
   316                     $excludePaths[] = str_replace(
'\\', 
'/', 
'#' . $moduleDir . 
'/registration.php#');
   317                     $excludePaths[] = str_replace(
'\\', 
'/', 
'#' . $moduleDir . 
'/cli_commands.php#');
   323                 array_merge($this->getModuleTestDirsRegex(), $excludePaths)
   335     private function getTestFiles($flags)
   337         if ($flags & self::INCLUDE_TESTS) {
   340                 BP . 
'/setup/src/Magento/Setup/Test',
   344                 $moduleTestDir[] = $moduleDir . 
'/Test';
   346             $libraryTestDirs = [];
   348                 $libraryTestDirs[] = $libraryDir . 
'/Test';
   349                 $libraryTestDirs[] = $libraryDir . 
'/*/Test';
   351             $testDirs = array_merge($testDirs, $moduleTestDir, $libraryTestDirs);
   383         $cacheKey = __METHOD__ . 
'|' . implode(
'|', [$asDataSet]);
   384         if (!isset(self::$_cache[$cacheKey])) {
   385             $configXmlPaths = [];
   387                 $configXmlPaths[] = $moduleDir . 
'/etc/config.xml';
   389                 $configXmlPaths[] = $moduleDir . 
'/etc/config.*.xml';
   391             $globPaths = [
BP . 
'/app/etc/config.xml', 
BP . 
'/app/etc/*/config.xml'];
   392             $configXmlPaths = array_merge($globPaths, $configXmlPaths);
   394             foreach ($configXmlPaths as $xmlPath) {
   395                 $files = array_merge(
$files, glob($xmlPath, GLOB_NOSORT));
   397             self::$_cache[$cacheKey] = 
$files;
   402         return self::$_cache[$cacheKey];
   415         $fileNamePattern = 
'*.xml',
   416         $excludedFileNames = [
'wsdl.xml', 
'wsdl2.xml', 
'wsi.xml'],
   419         $cacheKey = __METHOD__ . 
'|' . $this->serializer->serialize([$fileNamePattern, $excludedFileNames, $asDataSet]);
   420         if (!isset(self::$_cache[$cacheKey])) {
   424                 function ($file) use ($excludedFileNames) {
   425                     return !in_array(basename($file), $excludedFileNames);
   428             self::$_cache[$cacheKey] = 
$files;
   433         return self::$_cache[$cacheKey];
   447         $fileNamePattern = 
'*.xsd',
   448         $excludedFileNames = [],
   451         $cacheKey = __METHOD__ . 
'|' . $this->serializer->serialize([$fileNamePattern, $excludedFileNames, $asDataSet]);
   452         if (!isset(self::$_cache[$cacheKey])) {
   458             $libraryExcludeDirs = [];
   460                 $libraryExcludeDirs[] = str_replace(
'\\', 
'/', 
'#' . $libraryDir . 
'/Test#');
   461                 $libraryExcludeDirs[] = str_replace(
'\\', 
'/', 
'#' . $libraryDir) . 
'/[\\w]+/Test#';
   489                 function ($file) use ($excludedFileNames) {
   490                     return !in_array(basename($file), $excludedFileNames);
   493             self::$_cache[$cacheKey] = 
$files;
   498         return self::$_cache[$cacheKey];
   510         $cacheKey = __METHOD__ . 
'|' . implode(
'|', [$fileNamePattern, $asDataSet]);
   511         if (!isset(self::$_cache[$cacheKey])) {
   512             self::$_cache[$cacheKey] = $this->dirSearch->collectFiles(
   514                 "/etc/{$fileNamePattern}"   520         return self::$_cache[$cacheKey];
   604             'theme_path' => 
'*/*',
   605             'include_code' => 
true,
   606             'include_design' => 
true,
   607             'with_metainfo' => 
false   609         foreach (array_keys(
$params) as $key) {
   610             if (isset($incomingParams[$key])) {
   611                 $params[$key] = $incomingParams[$key];
   614         $cacheKey = md5($location . 
'|' . implode(
'|', 
$params));
   616         if (!isset(self::$_cache[__METHOD__][$cacheKey])) {
   621             if (
$params[
'include_design']) {
   625             self::$_cache[__METHOD__][$cacheKey] = 
$files;
   631         return self::$_cache[__METHOD__][$cacheKey];
   641     private function collectModuleLayoutFiles(array 
$params, $location)
   645         $requiredModuleName = 
$params[
'namespace'] . 
'_' . 
$params[
'module'];
   647             if ($requiredModuleName == 
'*_*' || $moduleName == $requiredModuleName) {
   650                     [$moduleDir . 
"/view/{$area}/{$location}"],
   654                 if (
$params[
'with_metainfo']) {
   655                     foreach ($moduleFiles as $moduleFile) {
   656                         $modulePath = str_replace(DIRECTORY_SEPARATOR, 
'/', preg_quote($moduleDir, 
'#'));
   657                         $regex = 
'#^' . $modulePath . 
'/view/(?P<area>[a-z]+)/layout/(?P<path>.+)$#i';
   658                         if (preg_match($regex, $moduleFile, $matches)) {
   667                             throw new \UnexpectedValueException(
"Could not parse modular layout file '$moduleFile'");
   685     private function collectThemeLayoutFiles(array 
$params, $location)
   689         $requiredModuleName = 
$params[
'namespace'] . 
'_' . 
$params[
'module'];
   690         $themePath = 
$params[
'theme_path'];
   691         foreach ($this->themePackageList->getThemes() as 
$theme) {
   692             $currentThemePath = str_replace(DIRECTORY_SEPARATOR, 
'/', 
$theme->getPath());
   693             $currentThemeCode = 
$theme->getVendor() . 
'/' . 
$theme->getName();
   694             if (($area == 
'*' || 
$theme->getArea() === $area)
   695                 && ($themePath == 
'*' || $themePath == 
'*/*' || $themePath == $currentThemeCode)
   699                     [$currentThemePath . 
"/{$requiredModuleName}/{$location}"],
   704                 if (
$params[
'with_metainfo']) {
   705                     $files = array_merge($this->parseThemeFiles($themeFiles, $currentThemePath, 
$theme));
   720     private function parseThemeFiles($themeFiles, $currentThemePath, 
$theme)
   723         $regex = 
'#^' . $currentThemePath
   724             . 
'/(?P<module>[a-z\d]+_[a-z\d]+)/layout/(override/((base/)|(theme/[a-z\d_]+/[a-z\d_]+/)))?'   726         foreach ($themeFiles as $themeFile) {
   727             if (preg_match($regex, $themeFile, $matches)) {
   736                 throw new \UnexpectedValueException(
"Could not parse theme layout file '$themeFile'");
   759         $params = [
'namespace' => 
'*', 
'module' => 
'*', 
'area' => 
'*'];
   760         foreach (array_keys(
$params) as $key) {
   761             if (isset($incomingParams[$key])) {
   762                 $params[$key] = $incomingParams[$key];
   765         $cacheKey = md5(implode(
'|', 
$params));
   767         if (!isset(self::$_cache[__METHOD__][$cacheKey])) {
   777         return self::$_cache[__METHOD__][$cacheKey];
   788     private function getEtcAreaPaths($namespace, $module, $area)
   792             $keyInfo = explode(
'_', $moduleName);
   793             if ($keyInfo[0] == $namespace || $namespace == 
'*') {
   794                 if ($keyInfo[1] == $module || $module == 
'*') {
   795                     $etcAreaPaths[] = $moduleDir . 
"/etc/{$area}";
   799         return $etcAreaPaths;
   811     public function getJsFiles($area = 
'*', $themePath = 
'*/*', $namespace = 
'*', $module = 
'*')
   813         $key = $area . $themePath . $namespace . $module . __METHOD__ . 
BP;
   814         if (isset(self::$_cache[$key])) {
   815             return self::$_cache[$key];
   817         $moduleWebPaths = [];
   819             $keyInfo = explode(
'_', $moduleName);
   820             if ($keyInfo[0] == $namespace || $namespace == 
'*') {
   821                 if ($keyInfo[1] == $module || $module == 
'*') {
   822                     $moduleWebPaths[] = $moduleDir . 
"/view/{$area}/web";
   826         $themePaths = $this->getThemePaths($area, $namespace . 
'_' . $module, 
'/web');
   830                     BP . 
"/lib/web/{mage,varien}"   848     private function getThemePaths($area, $module, $subFolder)
   851         foreach ($this->themePackageList->getThemes() as 
$theme) {
   852             if ($area == 
'*' || 
$theme->getArea() === $area) {
   853                 $themePaths[] = 
$theme->getPath() . $subFolder;
   854                 $themePaths[] = 
$theme->getPath() . 
"/{$module}" . $subFolder;
   871         $key = $area . $themePath . $namespace . $module . __METHOD__;
   872         if (isset(self::$_cache[$key])) {
   873             return self::$_cache[$key];
   875         $moduleTemplatePaths = [];
   877             $keyInfo = explode(
'_', $moduleName);
   878             if ($keyInfo[0] == $namespace || $namespace == 
'*') {
   879                 if ($keyInfo[1] == $module || $module == 
'*') {
   880                     $moduleTemplatePaths[] = $moduleDir . 
"/view/{$area}/web/template";
   881                     $moduleTemplatePaths[] = $moduleDir . 
"/view/{$area}/web/templates";
   885         $themePaths = $this->getThemePaths($area, $namespace . 
'_' . $module, 
'/web/template');
   906         $key = __METHOD__ . 
'|' . $filePattern;
   907         if (isset(self::$_cache[$key])) {
   908             return self::$_cache[$key];
   914         $moduleLocalePath = [];
   916             $moduleWebPath[] = $moduleDir . 
"/view/{$area}/web";
   917             $moduleLocalePath[] = $moduleDir . 
"/view/{$area}/web/i18n/{$locale}";
   922         $this->accumulateThemeStaticFiles($area, $locale, $filePattern, 
$result);
   936     private function accumulateThemeStaticFiles($area, $locale, $filePattern, &
$result)
   938         foreach ($this->themePackageList->getThemes() as $themePackage) {
   939             $themeArea = $themePackage->getArea();
   940             if ($area == 
'*' || $area == $themeArea) {
   942                 $themePath = str_replace(DIRECTORY_SEPARATOR, 
'/', $themePackage->getPath());
   945                     $themePath . 
"/*_*/web",
   946                     $themePath . 
"/web/i18n/{$locale}",
   947                     $themePath . 
"/*_*/web/i18n/{$locale}"   950                 $regex = 
'#^' . $themePath .
   951                     '/((?P<module>[a-z\d]+_[a-z\d]+)/)?web/(i18n/(?P<locale>[a-z_]+)/)?(?P<path>.+)$#i';
   952                 foreach (
$files as $file) {
   953                     if (preg_match($regex, $file, $matches)) {
   956                             $themePackage->getVendor() . 
'/' . $themePackage->getName(),
   963                         throw new \UnexpectedValueException(
"Could not parse theme static file '$file'");
   970                         $themePackage->getVendor() . 
'/' . $themePackage->getName(),
  1002         preg_match(
'/^' . preg_quote(
"{$path}/lib/web/", 
'/') . 
'(.+)$/i', $file, $matches);
  1017         $path = str_replace(DIRECTORY_SEPARATOR, 
'/', 
BP);
  1018         foreach (self::getFiles($patterns, $filePattern) as $file) {
  1019             $file = str_replace(DIRECTORY_SEPARATOR, 
'/', $file);
  1038                 '/^' . preg_quote(
"{$modulePath}/", 
'/') . 
'view\/([a-z]+)\/web\/(.+)$/i',
  1043                 list(, $area, $filePath) = $matches;
  1044                 return [$area, 
'', 
'', $moduleName, $filePath, $file];
  1059             $appCode = preg_quote(
"{$modulePath}/", 
'/');
  1060             if (preg_match(
'/^' . $appCode . 
'view\/([a-z]+)\/web\/i18n\/([a-z_]+)\/(.+)$/i', $file, $matches) === 1) {
  1061                 list(, $area, $locale, $filePath) = $matches;
  1062                 return [$area, 
'', $locale, $moduleName, $filePath, $file];
  1076         $key = __METHOD__ . 
BP . $area;
  1077         if (isset(self::$_cache[$key])) {
  1078             return self::$_cache[$key];
  1080         $viewAreaPaths = [];
  1082             $viewAreaPaths[] = $moduleDir . 
"/view/{$area}";
  1085         foreach ($this->themePackageList->getThemes() as 
$theme) {
  1086             if ($area == 
'*' || 
$theme->getArea() === $area) {
  1087                 $themePaths[] = 
$theme->getPath();
  1091             BP . 
"/lib/web/varien"  1093         $paths = array_merge(
$paths, $viewAreaPaths, $themePaths);
  1096         if ($area == 
'adminhtml') {
  1097             $adminhtmlPaths = [
BP . 
"/lib/web/mage/{adminhtml,backend}"];
  1098             $files = array_merge(
$files, self::getFiles($adminhtmlPaths, 
'*.js'));
  1100             $frontendPaths = [
BP . 
"/lib/web/mage"];
  1104             $files = array_merge(
$files, self::getFiles($frontendPaths, 
'*.js', 
false));
  1107         self::$_cache[$key] = 
$files;
  1120         $key = __METHOD__ . (int)$withMetaInfo;
  1121         if (!isset(self::$_cache[$key])) {
  1123             $this->accumulateModuleTemplateFiles($withMetaInfo, 
$result);
  1124             $this->accumulateThemeTemplateFiles($withMetaInfo, 
$result);
  1125             self::$_cache[$key] = 
$result;
  1130         return self::$_cache[$key];
  1143         $fileNamePattern = 
'db_schema.xml',
  1144         $excludedFileNames = [],
  1147         $cacheKey = __METHOD__ . 
'|' . $this->serializer->serialize([$fileNamePattern, $excludedFileNames, $asDataSet]);
  1148         if (!isset(self::$_cache[$cacheKey])) {
  1152                 function ($file) use ($excludedFileNames) {
  1153                     return !in_array(basename($file), $excludedFileNames);
  1156             self::$_cache[$cacheKey] = 
$files;
  1161         return self::$_cache[$cacheKey];
  1171     private function accumulateThemeTemplateFiles($withMetaInfo, array &
$result)
  1173         foreach ($this->themePackageList->getThemes() as 
$theme) {
  1176                 [
$theme->getPath() . 
'/*_*/templates'],
  1180             if ($withMetaInfo) {
  1181                 $regex = 
'#^' . str_replace(DIRECTORY_SEPARATOR, 
'/', 
$theme->getPath())
  1182                     . 
'/(?P<module>[a-z\d]+_[a-z\d]+)/templates/(?P<path>.+)$#i';
  1183                 foreach (
$files as $file) {
  1184                     if (preg_match($regex, $file, $matches)) {
  1193                         echo $regex . 
" - " . $file . 
"\n";
  1194                         throw new \UnexpectedValueException(
"Could not parse theme template file '$file'");
  1210     private function accumulateModuleTemplateFiles($withMetaInfo, array &
$result)
  1215                 [$moduleDir . 
"/view/*/templates"],
  1219             if ($withMetaInfo) {
  1220                 $modulePath = str_replace(DIRECTORY_SEPARATOR, 
'/', preg_quote($moduleDir, 
'#'));
  1221                 $regex = 
'#^' . $modulePath . 
'/view/(?P<area>[a-z]+)/templates/(?P<path>.+)$#i';
  1222                 foreach (
$files as $file) {
  1223                     if (preg_match($regex, $file, $matches)) {
  1232                         throw new \UnexpectedValueException(
"Could not parse module template file '$file'");
  1249         if (isset(self::$_cache[$key])) {
  1250             return self::$_cache[$key];
  1252         $moduleEmailPaths = [];
  1254             $moduleEmailPaths[] = $moduleDir . 
"/view/email";
  1258         self::$_cache[$key] = 
$result;
  1270         $key = __METHOD__ . 
BP;
  1271         if (isset(self::$_cache[$key])) {
  1272             return self::$_cache[$key];
  1276             [
BP . 
'/app', 
BP . 
'/dev', 
BP . 
'/lib', 
BP . 
'/pub'],
  1283         $rootFiles = glob(
BP . 
'/*', GLOB_NOSORT);
  1284         $rootFiles = array_filter(
  1291         $result = array_merge($rootFiles, $subFiles);
  1294         self::$_cache[$key] = 
$result;
  1306     public static function getFiles(array $dirPatterns, $fileNamePattern, $recursive = 
true)
  1309         foreach ($dirPatterns as $oneDirPattern) {
  1310             $oneDirPattern = str_replace(
'\\', 
'/', $oneDirPattern);
  1311             $entriesInDir = 
Glob::glob(
"{$oneDirPattern}/{$fileNamePattern}", Glob::GLOB_NOSORT | Glob::GLOB_BRACE);
  1312             $subDirs = 
Glob::glob(
"{$oneDirPattern}/*", Glob::GLOB_ONLYDIR | Glob::GLOB_NOSORT | Glob::GLOB_BRACE);
  1313             $filesInDir = array_diff($entriesInDir, $subDirs);
  1331         $primaryConfigs = 
Glob::glob(
BP . 
'/app/etc/{di.xml,*/di.xml}', Glob::GLOB_BRACE);
  1332         $moduleConfigs = [];
  1334             $moduleConfigs = array_merge(
  1336                 Glob::glob($moduleDir . 
'/etc/{di,*/di}.xml', Glob::GLOB_BRACE)
  1339         $configs = array_merge($primaryConfigs, $moduleConfigs);
  1343             foreach ($configs as $file) {
  1357     private function getPaths()
  1361             $directories[] = $fullModuleDir;
  1364             $directories[] = $libraryDir;
  1366         return $directories;
  1382         $classParts = explode(
'\\', 
$class);
  1384         $namespace = implode(
'\\', $classParts);
  1385         $path = implode(
'/', explode(
'\\', 
$class)) . 
'.php';
  1388             '/dev/tests/api-functional/framework',
  1389             '/dev/tests/setup-integration/framework',
  1390             '/dev/tests/integration/framework',
  1391             '/dev/tests/integration/framework/tests/unit/testsuite',
  1392             '/dev/tests/integration/testsuite',
  1393             '/dev/tests/integration/testsuite/Magento/Test/Integrity',
  1394             '/dev/tests/static/framework',
  1395             '/dev/tests/static/testsuite',
  1396             '/dev/tests/functional/tests/app',
  1397             '/dev/tests/functional/lib',
  1398             '/dev/tests/functional/vendor/magento/mtf',
  1401         foreach ($directories as $key => $dir) {
  1402             $directories[$key] = 
BP . $dir;
  1405         $directories = array_merge($directories, $this->getPaths());
  1407         foreach ($directories as $dir) {
  1408             $fullPath = $dir . 
'/' . 
$path;
  1409             if ($this->classFileExistsCheckContent($fullPath, $namespace, 
$className)) {
  1412             $classParts = explode(
'/', 
$path, 3);
  1413             if (count($classParts) >= 3) {
  1415                 $trimmedFullPath = $dir . 
'/' . $classParts[2];
  1416                 if ($this->classFileExistsCheckContent($trimmedFullPath, $namespace, 
$className)) {
  1420             $classParts = explode(
'/', 
$path, 4);
  1421             if (count($classParts) >= 4) {
  1423                 $trimmedFullPath = $dir . 
'/' . $classParts[3];
  1424                 if ($this->classFileExistsCheckContent($trimmedFullPath, $namespace, 
$className)) {
  1427                 $trimmedFullPath = $dir . 
'/' . $classParts[2] . 
'/' . $classParts[3];
  1428                 if ($this->classFileExistsCheckContent($trimmedFullPath, $namespace, 
$className)) {
  1444     private function classFileExistsCheckContent($fullPath, $namespace, 
$className)
  1452         if (realpath($fullPath) == str_replace([
'/', 
'\\'], DIRECTORY_SEPARATOR, $fullPath)
  1453             || file_exists($fullPath)
  1456             if (strpos($fileContent, 
'namespace ' . $namespace) !== 
false  1457                 && (strpos($fileContent, 
'class ' . 
$className) !== 
false  1458                     || strpos($fileContent, 
'interface ' . 
$className) !== 
false  1459                     || strpos($fileContent, 
'trait ' . 
$className) !== 
false)
  1475         if (isset(self::$_cache[$key])) {
  1476             return self::$_cache[$key];
  1481             $namespace = explode(
'_', $moduleName)[0];
  1482             if (!in_array($namespace, 
$result) && $namespace !== 
'Zend') {
  1486         self::$_cache[$key] = 
$result;
  1511         $key = __METHOD__ . 
"/{$module}";
  1512         if (!isset(self::$_cache[$key])) {
  1517             self::$_cache[$key] = 
$files;
  1524         return self::$_cache[$key];
  1536         $key = __METHOD__ . 
'|' . implode(
'|', [$componentType, $asDataSet]);
  1537         if (!isset(self::$_cache[$key])) {
  1540                 $this->componentRegistrar->getPaths($componentType),
  1545             self::$_cache[$key] = 
$files;
  1552         return self::$_cache[$key];
  1567         foreach (glob($globPattern) as $list) {
  1568             $patterns = array_merge($patterns, file($list, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
  1573         $incorrectPatterns = [];
  1578             $patternParts = explode(
' ', 
$pattern);
  1579             if (count($patternParts) == 3) {
  1580                 list($componentType, $componentName, 
$pathPattern) = $patternParts;
  1581                 $files = $this->getPathByComponentPattern($componentType, $componentName, 
$pathPattern);
  1582             } 
elseif (count($patternParts) == 1) {
  1589                 throw new \UnexpectedValueException(
  1590                     "Incorrect pattern record '$pattern'. Supported formats: "  1591                     . 
"'<componentType> <componentName> <glob_pattern>' or '<glob_pattern>'"  1599         if (!empty($incorrectPatterns)) {
  1600             throw new \Exception(
"The following patterns didn't return any result:\n" . join(
"\n", $incorrectPatterns));
  1613     private function getPathByComponentPattern($componentType, $componentName, 
$pathPattern)
  1616         if ($componentType == 
'*') {
  1624             $componentTypes = [$componentType];
  1626         foreach ($componentTypes as 
$type) {
  1627             if ($componentName == 
'*') {
  1630                 $componentDir = $this->componentRegistrar->getPath(
$type, $componentName);
  1631                 if (!empty($componentDir)) {
  1647         $key = __METHOD__ . 
"/{$moduleName}";
  1648         if (!isset(self::$_cache[$key])) {
  1649             self::$_cache[$key] = file_exists(
  1654         return self::$_cache[$key];
  1667         if (!is_array($excludes)) {
  1668             $excludes = [$excludes];
  1671         foreach ($excludes as $excludeRegex) {
  1672             $fileSet = preg_grep($excludeRegex, $fileSet, PREG_GREP_INVERT);
  1683     private function getSetupPhpFiles($flags = 
null)
  1686         $setupAppPath = 
BP . 
'/setup';
  1687         if ($flags & self::INCLUDE_SETUP && file_exists($setupAppPath)) {
  1688             $regexIterator = $this->regexIteratorFactory->create(
  1692             foreach ($regexIterator as $file) {
 
getFilesSubset(array $dirPatterns, $fileNamePattern, $excludes)
elseif(isset( $params[ 'redirect_parent']))
getPageLayoutFiles($incomingParams=[], $asDataSet=true)
getMainConfigFiles($asDataSet=true)
_parseLibStatic($file, $path)
static glob($pattern, $flags=0, $forceFallback=false)
static composeDataSets(array $files)
getLayoutXmlFiles($location, $incomingParams=[], $asDataSet=true)
getStaticPreProcessingFiles($filePattern=' *')
isModuleExists($moduleName)
getConfigFiles( $fileNamePattern=' *.xml', $excludedFileNames=['wsdl.xml', 'wsdl2.xml', 'wsi.xml'], $asDataSet=true)
getPageTypeFiles($incomingParams=[], $asDataSet=true)
const INCLUDE_NON_CLASSES
getLayoutFiles($incomingParams=[], $asDataSet=true)
_accumulateFilesByPatterns(array $patterns, $filePattern, array &$result, $subroutine=false)
$_option $_optionId $class
static setInstance(Files $instance=null)
getLayoutConfigFiles($fileNamePattern=' *.xml', $asDataSet=true)
_parseModuleLocaleStatic($file)
classFileExists($class, &$path='')
getJsFiles($area=' *', $themePath=' */*', $namespace=' *', $module=' *')
__construct(ComponentRegistrar $componentRegistrar, DirSearch $dirSearch, ThemePackageList $themePackageList, Json $serializer=null, RegexIteratorFactory $regexIteratorFactory=null)
getXmlCatalogFiles( $fileNamePattern=' *.xsd', $excludedFileNames=[], $asDataSet=true)
static getFiles(array $dirPatterns, $fileNamePattern, $recursive=true)
getModulePhpFiles($module, $asDataSet=true)
getDiConfigs($asDataSet=false)
getPhtmlFiles($withMetaInfo=false, $asDataSet=true)
getStaticHtmlFiles($area=' *', $themePath=' */*', $namespace=' *', $module=' *')
getComposerFiles($componentType, $asDataSet=true)
getDbSchemaFiles( $fileNamePattern='db_schema.xml', $excludedFileNames=[], $asDataSet=true)
_parseModuleStatic($file)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
getUiComponentXmlFiles($incomingParams=[], $asDataSet=true)
foreach($appDirs as $dir) $files
getModuleFile($namespace, $module, $file)