From c23ce16cafb826c8bb4fe7aaf2a5525b29052b23 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 6 Dec 2015 20:12:05 +0100 Subject: update smarty library - seems to bring some performance improvement --- .../smarty_internal_smartytemplatecompiler.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php') diff --git a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php index 50bd16ef2..ca9bc669b 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php @@ -11,7 +11,7 @@ /** * @ignore */ -include 'smarty_internal_parsetree.php'; +//include 'smarty_internal_parsetree.php'; /** * Class SmartyTemplateCompiler @@ -49,13 +49,6 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom */ public $parser; - /** - * Smarty object - * - * @var object - */ - public $smarty; - /** * array of vars which can be compiled in local scope * @@ -86,14 +79,17 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom * * @return bool true if compiling succeeded, false if it failed */ - protected function doCompile($_content) + protected function doCompile($_content, $isTemplateSource = false) { /* here is where the compiling takes place. Smarty tags in the templates are replaces with PHP code, then written to compiled files. */ // init the lexer/parser to compile the template - $this->lex = new $this->lexer_class($_content, $this); + $this->lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $_content), $this); $this->parser = new $this->parser_class($this->lex, $this); + if ($isTemplateSource) { + $this->parser->insertPhpCode("properties['nocache_hash'] = '{$this->nocache_hash}';\n?>\n"); + } if ($this->inheritance_child) { // start state on child templates $this->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY); -- cgit v1.2.3