aboutsummaryrefslogtreecommitdiffstats
path: root/library/Smarty/libs/sysplugins/smarty_internal_smartytemplatecompiler.php
diff options
context:
space:
mode:
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);