File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed 
src/Symfony/Bundle/AsseticBundle Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1111
1212namespace  Symfony \Bundle \AsseticBundle \Factory ;
1313
14- use  Assetic \Factory \Resource \ResourceInterface ;
14+ use  Assetic \Factory \Resource \FileResourceInterface ;
1515use  Symfony \Bundle \FrameworkBundle \Templating \TemplateReference ;
1616use  Symfony \Component \Templating \Loader \LoaderInterface ;
1717
2020 * 
2121 * @author Kris Wallsmith <kris.wallsmith@symfony-project.com> 
2222 */ 
23- class  FileResource implements  ResourceInterface 
23+ class  FileResource implements  FileResourceInterface 
2424{
2525 protected  $ loader
2626 protected  $ parser
@@ -56,6 +56,11 @@ public function getContent()
5656 return  $ this loader ->load ($ this getTemplate ())->getContent ();
5757 }
5858
59+  public  function  getPath ()
60+  {
61+  return  $ this path ;
62+  }
63+ 
5964 protected  function  getTemplate ()
6065 {
6166 if  (null  === $ this template ) {
Original file line number Diff line number Diff line change 1111
1212namespace  Symfony \Bundle \AsseticBundle \Routing ;
1313
14- use  Assetic \AssetManager ;
14+ use  Assetic \Factory \LazyAssetManager ;
15+ use  Assetic \Factory \Resource \FileResourceInterface ;
1516use  Symfony \Component \Config \Loader \Loader ;
17+ use  Symfony \Component \Config \Resource \FileResource ;
1618use  Symfony \Component \Routing \Route ;
1719use  Symfony \Component \Routing \RouteCollection ;
1820
@@ -37,14 +39,28 @@ class AsseticLoader extends Loader
3739{
3840 protected  $ am
3941
40-  public  function  __construct (AssetManager $ am
42+  public  function  __construct (LazyAssetManager $ am
4143 {
4244 $ this am  = $ am
4345 }
4446
4547 public  function  load ($ resource$ typenull )
4648 {
4749 $ routesnew  RouteCollection ();
50+ 
51+  // resources 
52+  foreach  ($ this am ->getResources () as  $ resource
53+  if  (!$ resourceinstanceof  \Traversable) {
54+  $ resourcearray ($ resource
55+  }
56+  foreach  ($ resourceas  $ r
57+  if  ($ rinstanceof  FileResourceInterface) {
58+  $ routesaddResource (new  FileResource ($ rgetPath ()));
59+  }
60+  }
61+  }
62+ 
63+  // routes 
4864 foreach  ($ this am ->getNames () as  $ name
4965 $ asset$ this am ->get ($ name
5066
                         You can’t perform that action at this time. 
           
                  
0 commit comments