]> git.mxchange.org Git - friendica.git/blobdiff - library/Smarty/libs/sysplugins/smarty_internal_compile_include_php.php
reverting tinymce changes, updating smarty to 3.1.19
[friendica.git] / library / Smarty / libs / sysplugins / smarty_internal_compile_include_php.php
index d52712368db66bdfb26d58dcf542ed1594226aaa..76f506c528a1d2a3b5379ac9972f9a4786d14155 100644 (file)
@@ -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