Skip to content

Commit

Permalink
Finder sent an exception when a folder doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Dyan committed Dec 8, 2015
1 parent c6042c2 commit cacb5ae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/LogicHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ public function getHooksDefinitionsFromFiles($module, $byFiles = true)

// find files in ExtDir
$customExtDir = 'custom/Extension/modules/' . $beanManager->getModuleDirectory($module) . '/Ext/LogicHooks/';
$finder = new Finder();
$finder->files()->in($customExtDir)->name('*.php');
foreach ($finder as $file) {
$files[] = $customExtDir . $file->getRelativePathname();
if (is_dir($customExtDir)) {
$finder = new Finder();
$finder->files()->in($customExtDir)->name('*.php');
foreach ($finder as $file) {
$files[] = $customExtDir . $file->getRelativePathname();
}
}

// read file and exit as soon as we find one
Expand Down

0 comments on commit cacb5ae

Please sign in to comment.