Browse Source

re-add filename based directory filter to the AnnotationDirectoryLoader,
now restricting to *.php files and therefore disregarding e.g. SVN metadata
files

Sven Paulus 14 years ago
parent
commit
eb8491f754

+ 3 - 1
src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php

@@ -37,7 +37,9 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader
         $dir = $this->locator->locate($path);
 
         $collection = new RouteCollection();
-        $collection->addResource(new DirectoryResource($dir));
+        $resource = new DirectoryResource($dir);
+        $resource->setFilterRegexList(array('/\.php$/'));
+        $collection->addResource($resource);
         foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
             if (!$file->isFile() || '.php' !== substr($file->getFilename(), -4)) {
                 continue;