From eab8a101e7a3fcbb41e01a574985e06c5a3775de Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 18 Oct 2018 02:40:38 +0200 Subject: Updating Smarty --- .../smarty_internal_compile_shared_inheritance.php | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php') diff --git a/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php index c955765..d90262e 100644 --- a/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php +++ b/lib/smarty3/sysplugins/smarty_internal_compile_shared_inheritance.php @@ -17,30 +17,33 @@ class Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_CompileBase { /** - * Register post compile callback to compile inheritance initialization code + * Compile inheritance initialization code as prefix * * @param \Smarty_Internal_TemplateCompilerBase $compiler * @param bool|false $initChildSequence if true force child template */ - public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) + public static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) { - if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) { - $compiler->registerPostCompileCallback(array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), - array($initChildSequence), 'inheritanceInit', $initChildSequence); - - $compiler->_cache[ 'inheritanceInit' ] = true; - } + $compiler->prefixCompiledCode .= "_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " . + var_export($initChildSequence, true) . ");\n?>\n"; } /** - * Compile inheritance initialization code as prefix + * Register post compile callback to compile inheritance initialization code * * @param \Smarty_Internal_TemplateCompilerBase $compiler * @param bool|false $initChildSequence if true force child template */ - static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) + public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false) { - $compiler->prefixCompiledCode .= "_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " . - var_export($initChildSequence, true) . ");\n?>\n"; + if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) { + $compiler->registerPostCompileCallback( + array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'), + array($initChildSequence), + 'inheritanceInit', + $initChildSequence + ); + $compiler->_cache[ 'inheritanceInit' ] = true; + } } -} \ No newline at end of file +} -- cgit v1.2.3