aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-12-06 20:12:05 +0100
committerMario Vavti <mario@mariovavti.com>2015-12-06 20:12:05 +0100
commitc23ce16cafb826c8bb4fe7aaf2a5525b29052b23 (patch)
tree2230b03cfa6b74f3898b57bee647bc6276fd5a53 /library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php
parent78a70fed2f7cf9a53e6e4fab516b00cece12fbf0 (diff)
downloadvolse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.tar.gz
volse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.tar.bz2
volse-hubzilla-c23ce16cafb826c8bb4fe7aaf2a5525b29052b23.zip
update smarty library - seems to bring some performance improvement
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php')
-rw-r--r--library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php16
1 files changed, 6 insertions, 10 deletions
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
@@ -50,13 +50,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
*
* @var array
@@ -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("<?php\n\$_smarty_tpl->properties['nocache_hash'] = '{$this->nocache_hash}';\n?>\n");
+ }
if ($this->inheritance_child) {
// start state on child templates
$this->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY);