From a17478ff743c72a89c40671e6315269a7cf63bf2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 7 Jun 2011 11:48:08 +0200 Subject: [PATCH] tweaked previous commit --- UPDATE.md | 2 ++ .../FrameworkBundle/Templating/Loader/TemplateLocator.php | 6 +++--- .../Tests/Templating/Loader/TemplateLocatorTest.php | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/UPDATE.md b/UPDATE.md index 271a98ca66..6f0f946668 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -9,6 +9,8 @@ timeline closely anyway. beta4 to beta5 -------------- +* All settings regarding the cache warmers have been removed. + * `Response::isRedirected()` has been merged with `Response::isRedirect()` beta3 to beta4 diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php index 2e1a45b00e..144ce3ffca 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php @@ -28,12 +28,12 @@ class TemplateLocator implements FileLocatorInterface /** * Constructor. * - * @param string $cacheDir The cache path * @param FileLocatorInterface $locator A FileLocatorInterface instance + * @param string $cacheDir The cache path */ - public function __construct($cacheDir, FileLocatorInterface $locator) + public function __construct(FileLocatorInterface $locator, $cacheDir = null) { - if (file_exists($cache = $cacheDir.'/templates.php')) { + if (null !== $cacheDir && file_exists($cache = $cacheDir.'/templates.php')) { $this->cache = require $cache; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php index e249dab510..daa164777a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php @@ -30,7 +30,7 @@ class TemplateLocatorTest extends TestCase ->will($this->returnValue('/path/to/template')) ; - $locator = new TemplateLocator('', $fileLocator); + $locator = new TemplateLocator($fileLocator); $this->assertEquals('/path/to/template', $locator->locate($template)); } @@ -50,7 +50,7 @@ class TemplateLocatorTest extends TestCase ->will($this->throwException(new \InvalidArgumentException())) ; - $locator = new TemplateLocator('', $fileLocator); + $locator = new TemplateLocator($fileLocator); $locator->locate($template); } @@ -60,7 +60,7 @@ class TemplateLocatorTest extends TestCase */ public function testThrowsAnExceptionWhenTemplateIsNotATemplateReferenceInterface() { - $locator = new TemplateLocator('', $this->getFileLocator()); + $locator = new TemplateLocator($this->getFileLocator()); $locator->locate('template'); }