Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix directory resource #2057

Merged
merged 1 commit into from

3 participants

@rande

fix regression introduces by 0eae562#diff-15

@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot 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
c8d6c60
@fabpot fabpot merged commit 74cbf96 into symfony:master
@schmittjoh

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

@fabpot fabpot referenced this pull request from a commit
@fabpot fabpot [Config] fixed FileResource usage of is_file (we must use file_exists…
… here as the resource can be a file or a directory, reverts #2057)
bede420
@fabpot
Owner

@schmittjoh: I have reverted this change and made the proper fix in the FileResource class instead (see bede420).

@dustinwhittle dustinwhittle referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@mmucklo mmucklo referenced this pull request from a commit
@fabpot fabpot 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
ee28908
@mmucklo mmucklo referenced this pull request from a commit
@fabpot fabpot [Config] fixed FileResource usage of is_file (we must use file_exists…
… here as the resource can be a file or a directory, reverts #2057)
380be4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 30, 2011
  1. @rande

    fix directory resource

    rande authored
This page is out of date. Refresh to see the latest.
View
7 src/Symfony/Bundle/DoctrineAbstractBundle/DependencyInjection/AbstractDoctrineExtension.php
@@ -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';
Something went wrong with that request. Please try again.