Permalink
Browse files

merged branch sonata-project/fix_directory_resource (PR #2057)

Commits
-------

74cbf96 fix directory resource

Discussion
----------

fix directory resource

fix regression introduces by 0eae562#diff-15
  • Loading branch information...
2 parents 053b421 + 74cbf96 commit c8d6c601921591fd4edf2b01d9820e772302098a @fabpot fabpot 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';

0 comments on commit c8d6c60

Please sign in to comment.