diff --git a/Resources/config/assetic.xml b/Resources/config/assetic.xml index 7d059791..090421b4 100644 --- a/Resources/config/assetic.xml +++ b/Resources/config/assetic.xml @@ -8,7 +8,6 @@ Symfony\Bundle\AsseticBundle\Factory\AssetFactory Assetic\Factory\LazyAssetManager Symfony\Bundle\AsseticBundle\CacheWarmer\AssetManagerCacheWarmer - Assetic\Factory\Loader\CachedFormulaLoader Assetic\Cache\ConfigCache Symfony\Bundle\AsseticBundle\Factory\Loader\ConfigurationLoader Symfony\Bundle\AsseticBundle\Factory\Resource\ConfigurationResource diff --git a/Resources/config/templating_php.xml b/Resources/config/templating_php.xml index b6843d92..741419f6 100644 --- a/Resources/config/templating_php.xml +++ b/Resources/config/templating_php.xml @@ -8,6 +8,7 @@ Symfony\Bundle\AsseticBundle\Templating\DynamicAsseticHelper Symfony\Bundle\AsseticBundle\Templating\StaticAsseticHelper Symfony\Bundle\AsseticBundle\Factory\Loader\AsseticHelperFormulaLoader + Assetic\Factory\Loader\CachedFormulaLoader diff --git a/Resources/config/templating_twig.xml b/Resources/config/templating_twig.xml index 8ab025bb..9e8cb92c 100644 --- a/Resources/config/templating_twig.xml +++ b/Resources/config/templating_twig.xml @@ -14,20 +14,15 @@ + %assetic.use_controller% %assetic.twig_extension.functions% %assetic.bundles% - + - - - - %kernel.debug% - - diff --git a/Tests/FunctionalTest.php b/Tests/FunctionalTest.php index 814c1cdb..090785f5 100644 --- a/Tests/FunctionalTest.php +++ b/Tests/FunctionalTest.php @@ -20,27 +20,27 @@ */ class FunctionalTest extends \PHPUnit_Framework_TestCase { - protected $cacheDir; + static protected $cacheDir; - protected function setUp() + static public function setUpBeforeClass() { if (!class_exists('Assetic\\AssetManager')) { - $this->markTestSkipped('Assetic is not available.'); + self::markTestSkipped('Assetic is not available.'); } - $this->cacheDir = __DIR__.'/Resources/cache'; - if (file_exists($this->cacheDir)) { + self::$cacheDir = __DIR__.'/Resources/cache'; + if (file_exists(self::$cacheDir)) { $filesystem = new Filesystem(); - $filesystem->remove($this->cacheDir); + $filesystem->remove(self::$cacheDir); } - mkdir($this->cacheDir, 0777, true); + mkdir(self::$cacheDir, 0777, true); } - protected function tearDown() + static public function tearDownAfterClass() { $filesystem = new Filesystem(); - $filesystem->remove($this->cacheDir); + $filesystem->remove(self::$cacheDir); } public function testTwigRenderDebug() diff --git a/Twig/AsseticExtension.php b/Twig/AsseticExtension.php index 3e84fe3f..5e72a252 100644 --- a/Twig/AsseticExtension.php +++ b/Twig/AsseticExtension.php @@ -11,9 +11,10 @@ namespace Symfony\Bundle\AsseticBundle\Twig; -use Assetic\ValueSupplierInterface; +use Assetic\Cache\ConfigCache; use Assetic\Extension\Twig\AsseticExtension as BaseAsseticExtension; use Assetic\Factory\AssetFactory; +use Assetic\ValueSupplierInterface; use Symfony\Component\Templating\TemplateNameParserInterface; /** @@ -27,9 +28,9 @@ class AsseticExtension extends BaseAsseticExtension private $templateNameParser; private $enabledBundles; - public function __construct(AssetFactory $factory, TemplateNameParserInterface $templateNameParser, $useController = false, $functions = array(), $enabledBundles = array(), ValueSupplierInterface $valueSupplier = null) + public function __construct(AssetFactory $factory, ConfigCache $cache, TemplateNameParserInterface $templateNameParser, $useController = false, $functions = array(), $enabledBundles = array(), ValueSupplierInterface $valueSupplier = null) { - parent::__construct($factory, $functions, $valueSupplier); + parent::__construct($factory, $cache, $functions, $valueSupplier); $this->useController = $useController; $this->templateNameParser = $templateNameParser; @@ -47,9 +48,9 @@ public function getTokenParsers() public function getNodeVisitors() { - return array( + return array_merge(parent::getNodeVisitors(), array( new AsseticNodeVisitor($this->templateNameParser, $this->enabledBundles), - ); + )); } public function getGlobals() diff --git a/composer.json b/composer.json index c3396a48..608c30e6 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "require": { "php": ">=5.3.0", "symfony/framework-bundle": ">=2.1.0,<2.3-dev", - "kriswallsmith/assetic": "1.1.*" + "kriswallsmith/assetic": "dev-node-visitor" }, "require-dev": { "symfony/twig-bundle": ">=2.1.0,<2.3-dev",