Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always skip hidden files #6567

Merged
merged 2 commits into from
Mar 25, 2017
Merged

Always skip hidden files #6567

merged 2 commits into from
Mar 25, 2017

Conversation

quickshiftin
Copy link
Contributor

@quickshiftin quickshiftin commented Sep 10, 2016

On Linux with Emacs or VI, hidden files can be generated by the editor, which are then picked up by the ClassScanner, so periodically I run into errors like this when running bin/magento di:compile

[Zend\Code\Exception\InvalidArgumentException]
File "" not found

Exception trace:
() at /home/nathan/gitRepos/ugrocery-mage/vendor/zendframework/zend-code/src/Scanner/FileScanner.php:31
Zend\Code\Scanner\FileScanner->__construct() at /home/nathan/gitRepos/ugrocery-mage/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php:67
Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList() at /home/nathan/gitRepos/ugrocery-mage/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php:61
Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation() at /home/nathan/gitRepos/ugrocery-mage/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
Magento\Setup\Module\Di\App\Task\Manager->process() at /home/nathan/gitRepos/ugrocery-mage/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:195
Magento\Setup\Console\Command\DiCompileCommand->execute() at /home/nathan/gitRepos/ugrocery-mage/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /home/nathan/gitRepos/ugrocery-mage/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /home/nathan/gitRepos/ugrocery-mage/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at /home/nathan/gitRepos/ugrocery-mage/vendor/magento/framework/Console/Cli.php:96
Magento\Framework\Console\Cli->doRun() at /home/nathan/gitRepos/ugrocery-mage/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /home/nathan/gitRepos/ugrocery-mage/bin/magento:23

You may prefer to implement it as another excludePattern, however I think it's worth adding in some fashion.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Sep 10, 2016

CLA assistant check
All committers have signed the CLA.

@quickshiftin
Copy link
Contributor Author

Hi, I just added my other email and accepted the license agreement - again...

@@ -87,6 +87,10 @@ public function getList($path)
*/
private function isExclude(\SplFileInfo $fileItem, $patterns)
{
if($fileItem->getBasename()[0] == '.') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add this check here, it will be invoked for every pattern, while it need to be invoked just once per file. The better place for this piece will be here as a third skipped case

if ($fileItem->isDir() || $fileItem->getExtension() !== 'php') {
                continue;
            }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing. I've updated the patch per your request.

@vrann vrann self-assigned this Mar 24, 2017
@vrann vrann added this to the March 2017 milestone Mar 24, 2017
@magento-team magento-team merged commit 48c1f69 into magento:develop Mar 25, 2017
magento-team pushed a commit that referenced this pull request Mar 25, 2017
magento-team pushed a commit that referenced this pull request Mar 25, 2017
@vrann
Copy link
Contributor

vrann commented Mar 25, 2017

@quickshiftin Merged! Thank you for your support.

@quickshiftin
Copy link
Contributor Author

Thank you guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants