[DependencyInjection] disable the possibility to have a reference in parameters (as it breaks as soon as you want to use the PHP dumper with no solution - performance wise)
This commit is contained in:
parent
63e7dda4c8
commit
c0152e1bba
@ -347,7 +347,7 @@ EOF;
|
||||
}
|
||||
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
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ class SymfonyTemplatingExtension extends LoaderExtension
|
||||
);
|
||||
}
|
||||
|
||||
$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
|
||||
@ -91,7 +91,7 @@ class SymfonyTemplatingExtension extends LoaderExtension
|
||||
);
|
||||
}
|
||||
|
||||
$configuration->setParameter('symfony.templating.helpers', $helpers);
|
||||
$configuration->getDefinition('symfony.templating.helperset')->addArgument($helpers);
|
||||
|
||||
// cache?
|
||||
if (isset($config['cache']))
|
||||
|
@ -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>
|
||||
@ -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%" />
|
||||
|
@ -34,7 +34,6 @@ $container->setParameters(array(
|
||||
'baz_class' => 'BazClass',
|
||||
'foo_class' => 'FooClass',
|
||||
'foo' => 'bar',
|
||||
'foo_bar' => new Reference('foo_bar'),
|
||||
));
|
||||
$container->setAlias('alias_for_foo', 'foo');
|
||||
$container->
|
||||
|
@ -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"];
|
||||
|
@ -148,7 +148,6 @@ class ProjectServiceContainer extends Container
|
||||
'baz_class' => 'BazClass',
|
||||
'foo_class' => 'FooClass',
|
||||
'foo' => 'bar',
|
||||
'foo_bar' => new Reference('foo_bar'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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">
|
||||
|
@ -2,7 +2,6 @@ parameters:
|
||||
baz_class: BazClass
|
||||
foo_class: FooClass
|
||||
foo: bar
|
||||
foo_bar: '@foo_bar'
|
||||
|
||||
services:
|
||||
foo:
|
||||
|
Reference in New Issue
Block a user