From b7237816a823ff69a492282780ad937e70da8c0d Mon Sep 17 00:00:00 2001 From: Nathan Nobbe Date: Sat, 10 Sep 2016 11:07:44 -0600 Subject: [PATCH 1/2] Always skip hidden files --- .../Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php index 04336639a3a43..a96c152e68a8b 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php @@ -87,6 +87,10 @@ public function getList($path) */ private function isExclude(\SplFileInfo $fileItem, $patterns) { + if($fileItem->getBasename()[0] == '.') { + return true; + } + if (!is_array($patterns)) { $patterns = (array)$patterns; } From 48c1f699cf4d140b68aed9c039e923fea1011638 Mon Sep 17 00:00:00 2001 From: Nathan Nobbe Date: Fri, 24 Mar 2017 11:48:53 -0600 Subject: [PATCH 2/2] Revised initial patch per @vrann --- .../Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php index a96c152e68a8b..fa4005af45f75 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php @@ -55,7 +55,7 @@ public function getList($path) $classes = []; foreach ($recursiveIterator as $fileItem) { /** @var $fileItem \SplFileInfo */ - if ($fileItem->isDir() || $fileItem->getExtension() !== 'php') { + if ($fileItem->isDir() || $fileItem->getExtension() !== 'php' || $fileItem->getBasename()[0] == '.') { continue; } foreach ($this->excludePatterns as $excludePatterns) { @@ -87,10 +87,6 @@ public function getList($path) */ private function isExclude(\SplFileInfo $fileItem, $patterns) { - if($fileItem->getBasename()[0] == '.') { - return true; - } - if (!is_array($patterns)) { $patterns = (array)$patterns; }