Optimized AnnotationDriver to filter found files during getAllClassnames().
This commit is contained in:
parent
0cd0ae49a1
commit
1fed340793
@ -495,18 +495,20 @@ class AnnotationDriver implements Driver
|
|||||||
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
|
throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
$iterator = new \RecursiveIteratorIterator(
|
$iterator = new \RegexIterator(
|
||||||
new \RecursiveDirectoryIterator($path),
|
new \RecursiveIteratorIterator(
|
||||||
\RecursiveIteratorIterator::LEAVES_ONLY
|
new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
|
||||||
|
\RecursiveIteratorIterator::LEAVES_ONLY
|
||||||
|
),
|
||||||
|
'/^.+\\' . $this->_fileExtension . '$/i',
|
||||||
|
\RecursiveRegexIterator::GET_MATCH
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($iterator as $file) {
|
foreach ($iterator as $file) {
|
||||||
if (($fileName = $file->getBasename($this->_fileExtension)) == $file->getBasename()) {
|
$sourceFile = realpath($file[0]);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sourceFile = realpath($file->getPathName());
|
|
||||||
require_once $sourceFile;
|
require_once $sourceFile;
|
||||||
|
|
||||||
$includedFiles[] = $sourceFile;
|
$includedFiles[] = $sourceFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user