Skip to content

Commit

Permalink
[DoctrineBundle] Make the proxy dir configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored and fabpot committed Dec 8, 2010
1 parent fb41389 commit 70a793b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ protected function loadOrmDefaults(array $config, ContainerBuilder $container)
'query_cache_driver',
'result_cache_driver',
'proxy_namespace',
'proxy_dir',
'auto_generate_proxy_classes'
);
foreach ($options as $key) {
Expand Down Expand Up @@ -250,7 +251,6 @@ protected function loadOrmEntityManagers(array $config, ContainerBuilder $contai
protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $container)
{
$defaultEntityManager = $container->getParameter('doctrine.orm.default_entity_manager');
$proxyCacheDir = $container->getParameter('kernel.cache_dir').'/doctrine/orm/Proxies';

$ormConfigDef = new Definition('Doctrine\ORM\Configuration');
$container->setDefinition(sprintf('doctrine.orm.%s_configuration', $entityManager['name']), $ormConfigDef);
Expand All @@ -263,7 +263,7 @@ protected function loadOrmEntityManager(array $entityManager, ContainerBuilder $
'setQueryCacheImpl' => new Reference(sprintf('doctrine.orm.%s_query_cache', $entityManager['name'])),
'setResultCacheImpl' => new Reference(sprintf('doctrine.orm.%s_result_cache', $entityManager['name'])),
'setMetadataDriverImpl' => new Reference('doctrine.orm.metadata_driver'),
'setProxyDir' => $proxyCacheDir,
'setProxyDir' => $container->getParameter('doctrine.orm.proxy_dir'),
'setProxyNamespace' => $container->getParameter('doctrine.orm.proxy_namespace'),
'setAutoGenerateProxyClasses' => $container->getParameter('doctrine.orm.auto_generate_proxy_classes')
);
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Bundle/DoctrineBundle/Resources/config/orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<!-- proxies -->
<parameter key="doctrine.orm.proxy_namespace">Proxies</parameter>
<parameter key="doctrine.orm.proxy_dir">%kernel.cache_dir%/doctrine/orm/Proxies</parameter>
<parameter key="doctrine.orm.auto_generate_proxy_classes">false</parameter>

<!-- cache -->
Expand Down

0 comments on commit 70a793b

Please sign in to comment.