diff options
author | plegall <plg@piwigo.org> | 2015-12-10 14:02:22 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-10 14:02:22 +0100 |
commit | fa10e0945ecd45bfe78a2c8fb015a43092b4944b (patch) | |
tree | 19cf59c08877e43325efbe9a2584114011a25522 /include/smarty/libs/sysplugins/smarty_internal_resource_stream.php | |
parent | 16f6a54fa719cc79ff942e4bb8139d7ca09ed997 (diff) |
bug #385 update to smarty-3.1.28-dev (from Github)
Diffstat (limited to '')
-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; } |