diff options
author | plegall <plg@piwigo.org> | 2015-12-30 16:21:32 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-30 16:21:32 +0100 |
commit | 3ec3cbe6cec5968d29cb11af139123191f4cb4ee (patch) | |
tree | 34aecd51071d63f8df1862a1a11898d8c43fe68a /include/smarty/libs/sysplugins/smarty_internal_resource_stream.php | |
parent | 6ba0148e646b2a193dc4111bb0a443d8c193e646 (diff) | |
parent | 1681b02ee98c2deb740d394280a2a685170bc72e (diff) |
Merge branch 'bug/385-php7'
Diffstat (limited to 'include/smarty/libs/sysplugins/smarty_internal_resource_stream.php')
-rw-r--r-- | include/smarty/libs/sysplugins/smarty_internal_resource_stream.php | 83 |
1 files changed, 43 insertions, 40 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php b/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php index 58086c179..8a902268c 100644 --- a/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php +++ b/include/smarty/libs/sysplugins/smarty_internal_resource_stream.php @@ -1,36 +1,35 @@ <?php /** -* Smarty Internal Plugin Resource Stream -* -* Implements the streams as resource for Smarty template -* -* @package Smarty -* @subpackage TemplateResources -* @author Uwe Tews -* @author Rodney Rehm -*/ + * Smarty Internal Plugin Resource Stream + * Implements the streams as resource for Smarty template + * + * @package Smarty + * @subpackage TemplateResources + * @author Uwe Tews + * @author Rodney Rehm + */ /** -* Smarty Internal Plugin Resource Stream -* -* Implements the streams as resource for Smarty template -* -* @link http://php.net/streams -* @package Smarty -* @subpackage TemplateResources -*/ -class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { - + * Smarty Internal Plugin Resource Stream + * Implements the streams as resource for Smarty template + * + * @link http://php.net/streams + * @package Smarty + * @subpackage TemplateResources + */ +class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled +{ /** - * populate Source Object with meta data from Resource - * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * @return void - */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template $_template template object + * + * @return void + */ + public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null) { - if(strpos($source->resource, '://') !== false) { + if (strpos($source->resource, '://') !== false) { $source->filepath = $source->resource; } else { $source->filepath = str_replace(':', '://', $source->resource); @@ -42,12 +41,13 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { } /** - * Load template's source from stream into current template object - * - * @param Smarty_Template_Source $source source object - * @return string template source - * @throws SmartyException if source cannot be loaded - */ + * Load template's source from stream into current template object + * + * @param Smarty_Template_Source $source source object + * + * @return string template source + * @throws SmartyException if source cannot be loaded + */ public function getContent(Smarty_Template_Source $source) { $t = ''; @@ -58,6 +58,7 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { $t .= $current_line; } fclose($fp); + return $t; } else { return false; @@ -65,13 +66,15 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { } /** - * modify resource_name according to resource handlers specifications - * - * @param Smarty $smarty Smarty instance - * @param string $resource_name resource_name to make unique - * @return string unique resource name - */ - protected function buildUniqueResourceName(Smarty $smarty, $resource_name) + * modify resource_name according to resource handlers specifications + * + * @param Smarty $smarty Smarty instance + * @param string $resource_name resource_name to make unique + * @param boolean $isConfig flag for config resource + * + * @return string unique resource name + */ + public function buildUniqueResourceName(Smarty $smarty, $resource_name, $isConfig = false) { return get_class($this) . '#' . $resource_name; } |