aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php')
-rw-r--r--vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php41
1 files changed, 23 insertions, 18 deletions
diff --git a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php
index f792496f9..983ca6180 100644
--- a/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php
+++ b/vendor/smarty/smarty/libs/sysplugins/smarty_internal_runtime_codeframe.php
@@ -25,9 +25,13 @@ class Smarty_Internal_Runtime_CodeFrame
*
* @return string
*/
- public function create(Smarty_Internal_Template $_template, $content = '', $functions = '', $cache = false,
- Smarty_Internal_TemplateCompilerBase $compiler = null)
- {
+ public function create(
+ Smarty_Internal_Template $_template,
+ $content = '',
+ $functions = '',
+ $cache = false,
+ Smarty_Internal_TemplateCompilerBase $compiler = null
+ ) {
// build property code
$properties[ 'version' ] = Smarty::SMARTY_VERSION;
$properties[ 'unifunc' ] = 'content_' . str_replace(array('.', ','), '_', uniqid('', true));
@@ -35,14 +39,14 @@ class Smarty_Internal_Runtime_CodeFrame
$properties[ 'has_nocache_code' ] = $_template->compiled->has_nocache_code;
$properties[ 'file_dependency' ] = $_template->compiled->file_dependency;
$properties[ 'includes' ] = $_template->compiled->includes;
- } else {
+ } else {
$properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code;
$properties[ 'file_dependency' ] = $_template->cached->file_dependency;
$properties[ 'cache_lifetime' ] = $_template->cache_lifetime;
}
$output = "<?php\n";
$output .= "/* Smarty version {$properties[ 'version' ]}, created on " . strftime("%Y-%m-%d %H:%M:%S") .
- "\n from '" . str_replace('*/','* /',$_template->source->filepath) . "' */\n\n";
+ "\n from '" . str_replace('*/', '* /', $_template->source->filepath) . "' */\n\n";
$output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n";
$dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' .
($cache ? 'true' : 'false') . ')';
@@ -56,11 +60,6 @@ class Smarty_Internal_Runtime_CodeFrame
if ($cache && isset($_template->smarty->ext->_tplFunction)) {
$output .= "\$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions(\$_smarty_tpl, " .
var_export($_template->smarty->ext->_tplFunction->getTplFunction($_template), true) . ");\n";
-
- }
- // include code for required plugins
- if (!$cache && isset($compiler)) {
- $output .= $compiler->compileRequiredPlugins();
}
$output .= "?>";
$output .= $content;
@@ -69,11 +68,15 @@ class Smarty_Internal_Runtime_CodeFrame
$output .= "<?php }\n";
// remove unneeded PHP tags
if (preg_match('/\s*\?>[\n]?<\?php\s*/', $output)) {
- $curr_split = preg_split('/\s*\?>[\n]?<\?php\s*/',
- $output);
- preg_match_all('/\s*\?>[\n]?<\?php\s*/',
- $output,
- $curr_parts);
+ $curr_split = preg_split(
+ '/\s*\?>[\n]?<\?php\s*/',
+ $output
+ );
+ preg_match_all(
+ '/\s*\?>[\n]?<\?php\s*/',
+ $output,
+ $curr_parts
+ );
$output = '';
foreach ($curr_split as $idx => $curr_output) {
$output .= $curr_output;
@@ -83,8 +86,10 @@ class Smarty_Internal_Runtime_CodeFrame
}
}
if (preg_match('/\?>\s*$/', $output)) {
- $curr_split = preg_split('/\?>\s*$/',
- $output);
+ $curr_split = preg_split(
+ '/\?>\s*$/',
+ $output
+ );
$output = '';
foreach ($curr_split as $idx => $curr_output) {
$output .= $curr_output;
@@ -92,4 +97,4 @@ class Smarty_Internal_Runtime_CodeFrame
}
return $output;
}
-} \ No newline at end of file
+}