From eff5529e1b495714ea9b9374c1d83bb63017b767 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 21 Jun 2013 10:37:08 +0200 Subject: [PATCH] change smarty cache and compile directory --- core/lib/Thelia/Config/Resources/config.xml | 2 ++ core/lib/Thelia/Core/Template/Smarty/SmartyParser.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index b3bb75fa3..a09cc086c 100644 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -51,6 +51,8 @@ + false + %kernel.environment% diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index 42f783b84..e85f53284 100644 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -32,7 +32,7 @@ class SmartyParser extends Smarty implements ParserInterface { * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * @param bool $template */ - public function __construct(Request $request, EventDispatcherInterface $dispatcher, $template = false) + public function __construct(Request $request, EventDispatcherInterface $dispatcher, $template = false, $env = "prod") { parent::__construct(); @@ -41,13 +41,13 @@ class SmartyParser extends Smarty implements ParserInterface { // Configure basic Smarty parameters - $compile_dir = THELIA_ROOT . 'cache/smarty/compile'; + $compile_dir = THELIA_ROOT . 'cache/'. $env .'/smarty/compile'; if (! is_dir($compile_dir)) @mkdir($compile_dir, 0777, true); - $cache_dir = THELIA_ROOT . 'cache/smarty/cache'; + $cache_dir = THELIA_ROOT . 'cache/'. $env .'/smarty/cache'; if (! is_dir($cache_dir)) @mkdir($cache_dir, 0777, true); - $this->setTemplate($template != false ? $template : 'smarty-sample'); + $this->setTemplate($template ?: 'smarty-sample'); $this->setCompileDir($compile_dir); $this->setCacheDir($cache_dir);