Permalink
Browse files

fix directory resource

  • Loading branch information...
1 parent 5bbc67b commit 74cbf96418fa2f2604124fa5d781beae29cd7317 @rande rande committed Aug 30, 2011
@@ -15,7 +15,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\Config\Resource\FileResource;
+use Symfony\Component\Config\Resource\DirectoryResource;
/**
* This abstract classes groups common code that Doctrine Object Manager extensions (ORM, MongoDB, CouchDB) need.
@@ -263,7 +263,8 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
while (!is_dir($resource)) {
$resource = dirname($resource);
}
- $container->addResource(new FileResource($resource));
+
+ $container->addResource(new DirectoryResource($resource));
$extension = $this->getMappingResourceExtension();
if (($files = glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) && count($files)) {
@@ -275,7 +276,7 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
}
// add the directory itself as a resource
- $container->addResource(new FileResource($dir));
+ $container->addResource(new DirectoryResource($dir));
if (is_dir($dir.'/'.$this->getMappingObjectDefaultName())) {
return 'annotation';

1 comment on commit 74cbf96

Contributor

schmittjoh commented on 74cbf96 Sep 14, 2011

This change effectively adds all bundles as directory resources to the container which has pretty bad performance implications.

Please sign in to comment.