diff options
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php')
-rw-r--r-- | vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php index b1ef958cd..ada38869d 100644 --- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -97,33 +97,38 @@ class Smarty_Internal_Config_File_Compiler * @param Smarty_Internal_Template $template * * @return bool true if compiling succeeded, false if it failed + * @throws \SmartyException */ public function compileTemplate(Smarty_Internal_Template $template) { $this->template = $template; $this->template->compiled->file_dependency[ $this->template->source->uid ] = - array($this->template->source->filepath, $this->template->source->getTimeStamp(), + array($this->template->source->filepath, + $this->template->source->getTimeStamp(), $this->template->source->type); if ($this->smarty->debugging) { - if (!isset( $this->smarty->_debug)) { - $this->smarty->_debug = new Smarty_Internal_Debug(); + if (!isset($this->smarty->_debug)) { + $this->smarty->_debug = new Smarty_Internal_Debug(); } $this->smarty->_debug->start_compile($this->template); } // init the lexer/parser to compile the config file - /* @var Smarty_Internal_ConfigFileLexer $this->lex */ - $this->lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $template->source->getContent()) . "\n", - $this); - /* @var Smarty_Internal_ConfigFileParser $this->parser */ + /* @var Smarty_Internal_ConfigFileLexer $this ->lex */ + $this->lex = new $this->lexer_class(str_replace(array("\r\n", + "\r"), "\n", $template->source->getContent()) . "\n", + $this); + /* @var Smarty_Internal_ConfigFileParser $this ->parser */ $this->parser = new $this->parser_class($this->lex, $this); - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + if (function_exists('mb_internal_encoding') + && function_exists('ini_get') + && ((int) ini_get('mbstring.func_overload')) & 2 + ) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } else { $mbEncoding = null; } - if ($this->smarty->_parserdebug) { $this->parser->PrintTrace(); } @@ -147,7 +152,7 @@ class Smarty_Internal_Config_File_Compiler $template_header = "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n"; - $template_header .= " compiled from \"" . $this->template->source->filepath . "\" */ ?>\n"; + $template_header .= " compiled from '{$this->template->source->filepath}' */ ?>\n"; $code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' . var_export($this->config_data, true) . '); ?>'; |