diff options
Diffstat (limited to 'library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php')
-rw-r--r-- | library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php index d52712368..76f506c52 100644 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php +++ b/library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php @@ -1,22 +1,21 @@ <?php /** * Smarty Internal Plugin Compile Include PHP - * * Compiles the {include_php} tag * - * @package Smarty + * @package Smarty * @subpackage Compiler - * @author Uwe Tews + * @author Uwe Tews */ /** * Smarty Internal Plugin Compile Insert Class * - * @package Smarty + * @package Smarty * @subpackage Compiler */ -class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { - +class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase +{ /** * Attribute definition: Overwrites base class. * @@ -42,8 +41,10 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { /** * Compiles code for the {include_php} tag * - * @param array $args array with attributes from parser - * @param object $compiler compiler object + * @param array $args array with attributes from parser + * @param object $compiler compiler object + * + * @throws SmartyException * @return string compiled code */ public function compile($args, $compiler) @@ -54,8 +55,9 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->getAttributes($compiler, $args); - $_output = '<?php '; - + /** @var Smarty_Internal_Template $_smarty_tpl + * used in evaluated code + */ $_smarty_tpl = $compiler->template; $_filepath = false; eval('$_file = ' . $_attr['file'] . ';'); @@ -68,10 +70,10 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { $_dir = $compiler->smarty->trusted_dir; } if (!empty($_dir)) { - foreach((array)$_dir as $_script_dir) { + foreach ((array) $_dir as $_script_dir) { $_script_dir = rtrim($_script_dir, '/\\') . DS; if (file_exists($_script_dir . $_file)) { - $_filepath = $_script_dir . $_file; + $_filepath = $_script_dir . $_file; break; } } @@ -102,7 +104,4 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase { return "<?php include{$_once} ('{$_filepath}');?>\n"; } } - } - -?>
\ No newline at end of file |