Merge branch 'admin' of github.com:thelia/thelia into admin

This commit is contained in:
Etienne Roudeix
2013-06-21 10:38:36 +02:00
2 changed files with 6 additions and 4 deletions

View File

@@ -51,6 +51,8 @@
<service id="thelia.parser" class="Thelia\Core\Template\Smarty\SmartyParser" scope="request"> <service id="thelia.parser" class="Thelia\Core\Template\Smarty\SmartyParser" scope="request">
<argument type="service" id="request" /> <argument type="service" id="request" />
<argument type="service" id="event_dispatcher"/> <argument type="service" id="event_dispatcher"/>
<argument >false</argument>
<argument >%kernel.environment%</argument>
</service> </service>
<!-- Smarty parser plugins --> <!-- Smarty parser plugins -->

View File

@@ -32,7 +32,7 @@ class SmartyParser extends Smarty implements ParserInterface {
* @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
* @param bool $template * @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(); parent::__construct();
@@ -41,13 +41,13 @@ class SmartyParser extends Smarty implements ParserInterface {
// Configure basic Smarty parameters // 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); 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); 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->setCompileDir($compile_dir);
$this->setCacheDir($cache_dir); $this->setCacheDir($cache_dir);