Преглед изворни кода

[AsseticBundle] fixed ScopeWideningInjectionExc in prod evn using php templates

The definition "assetic.helper.static" references the service "templating.helper.assets" which belongs to a narrower scope. Generally, it is safer to either move "assetic.helper.static" to scope "request" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "templating.helper.assets" each time it is needed. In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.
Peter Zwosta пре 14 година
родитељ
комит
c0e120e072
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml

+ 1 - 1
src/Symfony/Bundle/AsseticBundle/Resources/config/templating_php.xml

@@ -17,7 +17,7 @@
             <argument type="service" id="assetic.asset_factory" />
         </service>
 
-        <service id="assetic.helper.static" class="%assetic.helper.static.class%">
+        <service id="assetic.helper.static" class="%assetic.helper.static.class%" scope="request">
             <tag name="assetic.templating.php" />
             <argument type="service" id="templating.helper.assets" />
             <argument type="service" id="assetic.asset_factory" />