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);