Procházet zdrojové kódy

merged branch kriswallsmith/assetic/lazy-finder (PR #1320)

Commits
-------

4016dfb [AsseticBundle] moved ExecutableFinder back into a closure so it's only called if needed

Discussion
----------

[AsseticBundle] moved ExecutableFinder back into a closure

[AsseticBundle] moved ExecutableFinder back into a closure so it's only called if needed

---------------------------------------------------------------------------

by fabpot at 2011/06/14 05:46:14 -0700

Does it relate to #1319?

---------------------------------------------------------------------------

by kriswallsmith at 2011/06/14 05:47:25 -0700

It's related, yes, but I don't think it's a solution for the issue.

---------------------------------------------------------------------------

by dlsniper at 2011/06/14 06:00:55 -0700

The issue in #1319 has been fixed with this: https://github.com/symfony/symfony/commit/0d54f5c21e28c96160510f05580d8b6e29185f87
It's in the latest master tree but finding that file only when needed is also a good idea.
Fabien Potencier před 14 roky
rodič
revize
be3587d165

+ 3 - 3
src/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php

@@ -57,9 +57,9 @@ class Configuration implements ConfigurationInterface
                 ->booleanNode('use_controller')->defaultValue($this->debug)->end()
                 ->scalarNode('read_from')->defaultValue('%kernel.root_dir%/../web')->end()
                 ->scalarNode('write_to')->defaultValue('%assetic.read_from%')->end()
-                ->scalarNode('java')->defaultValue($finder->find('java', '/usr/bin/java'))->end()
-                ->scalarNode('node')->defaultValue($finder->find('node', '/usr/bin/node'))->end()
-                ->scalarNode('sass')->defaultValue($finder->find('sass', '/usr/bin/sass'))->end()
+                ->scalarNode('java')->defaultValue(function() use($finder) { return $finder->find('java', '/usr/bin/java'); })->end()
+                ->scalarNode('node')->defaultValue(function() use($finder) { return $finder->find('node', '/usr/bin/node'); })->end()
+                ->scalarNode('sass')->defaultValue(function() use($finder) { return $finder->find('sass', '/usr/bin/sass'); })->end()
             ->end()
 
             // bundles