Skip to content

Commit

Permalink
[DependencyInjection] disable the possibility to have a reference in …
Browse files Browse the repository at this point in the history
…parameters (as it breaks as soon as you want to use the PHP dumper with no solution - performance wise)
  • Loading branch information
fabpot committed Jan 18, 2010
1 parent 63e7dda commit c0152e1
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 14 deletions.
Expand Up @@ -347,7 +347,7 @@ protected function exportParameters($parameters, $indent = 6)
}
elseif ($value instanceof Reference)
{
$value = sprintf("new Reference('%s')", $value);
throw new \InvalidArgumentException(sprintf('You cannot dump a container with parameters that contain references to other services (reference to service %s found).', $value));
}
else
{
Expand Down
Expand Up @@ -70,7 +70,7 @@ public function templatingLoad($config)
);
}

$configuration->setParameter('symfony.templating.loader.chain.loaders', $loaders);
$configuration->getDefinition('symfony.templating.loader.chain')->addArgument($loaders);
$configuration->setAlias('symfony.templating.loader', 'symfony.templating.loader.chain');

// helpers
Expand All @@ -91,7 +91,7 @@ public function templatingLoad($config)
);
}

$configuration->setParameter('symfony.templating.helpers', $helpers);
$configuration->getDefinition('symfony.templating.helperset')->addArgument($helpers);

// cache?
if (isset($config['cache']))
Expand Down
Expand Up @@ -21,9 +21,7 @@
<argument type="service" id="symfony.templating.helperset" />
</service>

<service id="symfony.templating.helperset" class="%symfony.templating.helperset.class%">
<argument>%symfony.templating.helpers%</argument>
</service>
<service id="symfony.templating.helperset" class="%symfony.templating.helperset.class%" />

<service id="symfony.templating.loader.filesystem" class="%symfony.templating.loader.filesystem.class%">
<argument>%symfony.templating.loader.filesystem.path%</argument>
Expand All @@ -34,9 +32,7 @@
<argument>%symfony.templating.loader.cache.path%</argument>
</service>

<service id="symfony.templating.loader.chain" class="%symfony.templating.loader.chain.class%">
<argument>%symfony.templating.loader.chain.loaders%</argument>
</service>
<service id="symfony.templating.loader.chain" class="%symfony.templating.loader.chain.class%" />

<service id="symfony.templating.helper.javascripts" class="%symfony.templating.helper.javascripts.class%" />
<service id="symfony.templating.helper.stylesheets" class="%symfony.templating.helper.stylesheets.class%" />
Expand Down
Expand Up @@ -34,7 +34,6 @@
'baz_class' => 'BazClass',
'foo_class' => 'FooClass',
'foo' => 'bar',
'foo_bar' => new Reference('foo_bar'),
));
$container->setAlias('alias_for_foo', 'foo');
$container->
Expand Down
Expand Up @@ -13,7 +13,6 @@ digraph sc {
node_foo -> node_foo_baz [label="" style="filled"];
node_foo -> node_service_container [label="" style="filled"];
node_bar -> node_foo_baz [label="" style="filled"];
node_bar -> node_foo_bar [label="" style="filled"];
node_method_call1 -> node_foo [label="setBar()" style="dashed"];
node_method_call1 -> node_foo [label="setBar()" style="dashed"];
node_method_call1 -> node_foo [label="setBar()" style="dashed"];
Expand Down
Expand Up @@ -148,7 +148,6 @@ protected function getDefaultParameters()
'baz_class' => 'BazClass',
'foo_class' => 'FooClass',
'foo' => 'bar',
'foo_bar' => new Reference('foo_bar'),
);
}
}
Expand Up @@ -7,7 +7,6 @@
<parameter key="baz_class">BazClass</parameter>
<parameter key="foo_class">FooClass</parameter>
<parameter key="foo">bar</parameter>
<parameter key="foo_bar" type="service" id="foo_bar" />
</parameters>
<services>
<service id="foo" class="FooClass" constructor="getInstance" shared="false">
Expand Down
Expand Up @@ -2,7 +2,6 @@ parameters:
baz_class: BazClass
foo_class: FooClass
foo: bar
foo_bar: '@foo_bar'

services:
foo:
Expand Down

0 comments on commit c0152e1

Please sign in to comment.