From a6c179d56973e382205c8583568d635c37f814c8 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Tue, 27 Aug 2019 13:05:48 -0600 Subject: Updates smarty to v3.1.33. --- .../smarty_internal_runtime_codeframe.php | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 lib/smarty-3.1.33/sysplugins/smarty_internal_runtime_codeframe.php (limited to 'lib/smarty-3.1.33/sysplugins/smarty_internal_runtime_codeframe.php') diff --git a/lib/smarty-3.1.33/sysplugins/smarty_internal_runtime_codeframe.php b/lib/smarty-3.1.33/sysplugins/smarty_internal_runtime_codeframe.php new file mode 100644 index 0000000..983ca61 --- /dev/null +++ b/lib/smarty-3.1.33/sysplugins/smarty_internal_runtime_codeframe.php @@ -0,0 +1,100 @@ +compiled->has_nocache_code; + $properties[ 'file_dependency' ] = $_template->compiled->file_dependency; + $properties[ 'includes' ] = $_template->compiled->includes; + } else { + $properties[ 'has_nocache_code' ] = $_template->cached->has_nocache_code; + $properties[ 'file_dependency' ] = $_template->cached->file_dependency; + $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; + } + $output = "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') . ')'; + $output .= "if ({$dec}) {\n"; + $output .= "function {$properties['unifunc']} (Smarty_Internal_Template \$_smarty_tpl) {\n"; + if (!$cache && !empty($compiler->tpl_function)) { + $output .= '$_smarty_tpl->smarty->ext->_tplFunction->registerTplFunctions($_smarty_tpl, '; + $output .= var_export($compiler->tpl_function, true); + $output .= ");\n"; + } + 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"; + } + $output .= "?>"; + $output .= $content; + $output .= ""; + $output .= $functions; + $output .= "[\n]?<\?php\s*/', $output)) { + $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; + if (isset($curr_parts[ 0 ][ $idx ])) { + $output .= "\n"; + } + } + } + if (preg_match('/\?>\s*$/', $output)) { + $curr_split = preg_split( + '/\?>\s*$/', + $output + ); + $output = ''; + foreach ($curr_split as $idx => $curr_output) { + $output .= $curr_output; + } + } + return $output; + } +} -- cgit v1.2.3