diff options
author | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-12-11 20:15:27 +0000 |
---|---|---|
committer | Thomas Willingham <beardyunixer@beardyunixer.com> | 2014-12-11 20:15:27 +0000 |
commit | 967ab871b836f618107fe144978bd1453c3c6634 (patch) | |
tree | 1bcb1b4bb1b25c904a2bc06f5c6d526d29909eaa /library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php | |
parent | 960c35bad3a0dbaa7a1f2191aef60ad014d926ca (diff) | |
download | volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.gz volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.tar.bz2 volse-hubzilla-967ab871b836f618107fe144978bd1453c3c6634.zip |
Update Smarty
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 |