浏览代码

[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" />