Merge branch 'admin' of github.com:thelia/thelia into admin
This commit is contained in:
@@ -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 -->
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user