diff --git a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php index 77cad3c046d7..0a800f01c3f7 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/FileLoader.php @@ -110,7 +110,7 @@ private function findClasses($namespace, $pattern, $excludePattern) $excludePrefix = null; if ($excludePattern) { $excludePattern = $parameterBag->unescapeValue($parameterBag->resolveValue($excludePattern)); - foreach ($this->glob($excludePattern, true, $resource) as $path => $info) { + foreach ($this->glob($excludePattern, true, $resource, true) as $path => $info) { if (null === $excludePrefix) { $excludePrefix = $resource->getPrefix(); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php index ffe58a67ef3b..cbcc6995170c 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php @@ -134,6 +134,13 @@ public function testRegisterClassesWithExclude() ], array_keys($container->getAliases()) ); + + $loader->registerClasses( + new Definition(), + 'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\\', + 'Prototype/*', + 'Prototype/NotExistingDir' + ); } public function testNestedRegisterClasses()