summaryrefslogtreecommitdiff
path: root/libs/sysplugins/smarty_internal_config_file_compiler.php
diff options
context:
space:
mode:
Diffstat (limited to 'libs/sysplugins/smarty_internal_config_file_compiler.php')
-rw-r--r--libs/sysplugins/smarty_internal_config_file_compiler.php32
1 files changed, 17 insertions, 15 deletions
diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php
index 56d3b066..61328ce2 100644
--- a/libs/sysplugins/smarty_internal_config_file_compiler.php
+++ b/libs/sysplugins/smarty_internal_config_file_compiler.php
@@ -87,8 +87,8 @@ class Smarty_Internal_Config_File_Compiler
$this->lexer_class = $lexer_class;
$this->parser_class = $parser_class;
$this->smarty = $smarty;
- $this->config_data['sections'] = array();
- $this->config_data['vars'] = array();
+ $this->config_data[ 'sections' ] = array();
+ $this->config_data[ 'vars' ] = array();
}
/**
@@ -101,16 +101,16 @@ class Smarty_Internal_Config_File_Compiler
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(),
- $this->template->source->type);
+ $this->template->compiled->file_dependency[ $this->template->source->uid ] =
+ array($this->template->source->filepath, $this->template->source->getTimeStamp(),
+ $this->template->source->type);
if ($this->smarty->debugging) {
$this->smarty->_debug->start_compile($this->template);
}
// init the lexer/parser to compile the config file
/* @var Smarty_Internal_ConfigFileLexer $lex */
- $lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $template->source->getContent()) .
- "\n", $this);
+ $lex = new $this->lexer_class(str_replace(array("\r\n", "\r"), "\n", $template->source->getContent()) . "\n",
+ $this);
/* @var Smarty_Internal_ConfigFileParser $parser */
$parser = new $this->parser_class($lex, $this);
@@ -141,12 +141,13 @@ class Smarty_Internal_Config_File_Compiler
$this->smarty->_debug->end_compile($this->template);
}
// template header code
- $template_header = "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " .
- strftime("%Y-%m-%d %H:%M:%S") . "\n";
+ $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";
$code = '<?php $_smarty_tpl->smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' .
- var_export($this->config_data, true) . '); ?>';
+ var_export($this->config_data, true) . '); ?>';
return $template_header . $this->template->smarty->ext->_codeFrame->create($this->template, $code);
}
@@ -170,20 +171,21 @@ class Smarty_Internal_Config_File_Compiler
// $line--;
}
$match = preg_split("/\n/", $this->lex->data);
- $error_text = "Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' ";
+ $error_text =
+ "Syntax error in config file '{$this->template->source->filepath}' on line {$line} '{$match[$line - 1]}' ";
if (isset($args)) {
// individual error message
$error_text .= $args;
} else {
// expected token from parser
foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
- $exp_token = $this->parser->yyTokenName[$token];
- if (isset($this->lex->smarty_token_names[$exp_token])) {
+ $exp_token = $this->parser->yyTokenName[ $token ];
+ if (isset($this->lex->smarty_token_names[ $exp_token ])) {
// token type from lexer
- $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
+ $expect[] = '"' . $this->lex->smarty_token_names[ $exp_token ] . '"';
} else {
// otherwise internal token name
- $expect[] = $this->parser->yyTokenName[$token];
+ $expect[] = $this->parser->yyTokenName[ $token ];
}
}
// output parser error message