Skip to content

Commit

Permalink
fixed bug on multiple instances
Browse files Browse the repository at this point in the history
  • Loading branch information
liuggio committed Jan 13, 2014
1 parent f736b65 commit 2d88bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;

Expand Down Expand Up @@ -103,6 +104,8 @@ protected function getOrCreateDefinition(ContainerBuilder $container, $name = 'd
*/
protected function createGodFatherDefinition(ContainerBuilder $container, $prefix)
{
return new Definition('%godfather.class%', array($prefix, $container));
$container = new Reference('godfather_service_container');

return new Definition('%godfather.class%', array($container, $prefix));
}
}
4 changes: 2 additions & 2 deletions sf2-bundle/PUGX/GodfatherBundle/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
</parameters>

<services>
<service id="godfather" class="%godfather.class%" lazy="true">
<service id="godfather" class="%godfather.class%">
<argument type="service" id="godfather_service_container" />
<argument>godfather</argument>
</service>
<service id="godfather_service_container" class="%godfather.container.class%" lazy="true" public="false">
<service id="godfather_service_container" class="%godfather.container.class%" public="false">
<argument type="service" id="service_container" />
</service>
</services>
Expand Down

0 comments on commit 2d88bb7

Please sign in to comment.