aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/sysplugins/smarty_resource_custom.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-30 16:21:32 +0100
committerplegall <plg@piwigo.org>2015-12-30 16:21:32 +0100
commit3ec3cbe6cec5968d29cb11af139123191f4cb4ee (patch)
tree34aecd51071d63f8df1862a1a11898d8c43fe68a /include/smarty/libs/sysplugins/smarty_resource_custom.php
parent6ba0148e646b2a193dc4111bb0a443d8c193e646 (diff)
parent1681b02ee98c2deb740d394280a2a685170bc72e (diff)
Merge branch 'bug/385-php7'
Diffstat (limited to 'include/smarty/libs/sysplugins/smarty_resource_custom.php')
-rw-r--r--include/smarty/libs/sysplugins/smarty_resource_custom.php41
1 files changed, 20 insertions, 21 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_resource_custom.php b/include/smarty/libs/sysplugins/smarty_resource_custom.php
index 9ec1f356b..619f2d6f0 100644
--- a/include/smarty/libs/sysplugins/smarty_resource_custom.php
+++ b/include/smarty/libs/sysplugins/smarty_resource_custom.php
@@ -2,21 +2,20 @@
/**
* Smarty Resource Plugin
*
- * @package Smarty
+ * @package Smarty
* @subpackage TemplateResources
- * @author Rodney Rehm
+ * @author Rodney Rehm
*/
/**
* Smarty Resource Plugin
- *
* Wrapper Implementation for custom resource plugins
*
- * @package Smarty
+ * @package Smarty
* @subpackage TemplateResources
*/
-abstract class Smarty_Resource_Custom extends Smarty_Resource {
-
+abstract class Smarty_Resource_Custom extends Smarty_Resource
+{
/**
* fetch template and its modification time from data source
*
@@ -24,15 +23,15 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource {
* @param string &$source template source
* @param integer &$mtime template modification timestamp (epoch)
*/
- protected abstract function fetch($name, &$source, &$mtime);
+ abstract protected function fetch($name, &$source, &$mtime);
/**
* Fetch template's modification timestamp from data source
- *
* {@internal implementing this method is optional.
* Only implement it if modification times can be accessed faster than loading the complete template source.}}
*
- * @param string $name template name
+ * @param string $name template name
+ *
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
*/
protected function fetchTimestamp($name)
@@ -46,9 +45,9 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource {
* @param Smarty_Template_Source $source source object
* @param Smarty_Internal_Template $_template template object
*/
- public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template = null)
{
- $source->filepath = strtolower($source->type . ':' . $source->name);
+ $source->filepath = $source->type . ':' . $source->name;
$source->uid = sha1($source->type . ':' . $source->name);
$mtime = $this->fetchTimestamp($source->name);
@@ -57,8 +56,9 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource {
} else {
$this->fetch($source->name, $content, $timestamp);
$source->timestamp = isset($timestamp) ? $timestamp : false;
- if( isset($content) )
+ if (isset($content)) {
$source->content = $content;
+ }
}
$source->exists = !!$source->timestamp;
}
@@ -66,9 +66,10 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource {
/**
* Load template's source into current template object
*
- * @param Smarty_Template_Source $source source object
- * @return string template source
- * @throws SmartyException if source cannot be loaded
+ * @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)
{
@@ -83,14 +84,12 @@ abstract class Smarty_Resource_Custom extends Smarty_Resource {
/**
* Determine basename for compiled filename
*
- * @param Smarty_Template_Source $source source object
- * @return string resource's basename
+ * @param Smarty_Template_Source $source source object
+ *
+ * @return string resource's basename
*/
- protected function getBasename(Smarty_Template_Source $source)
+ public function getBasename(Smarty_Template_Source $source)
{
return basename($source->name);
}
-
}
-
-?> \ No newline at end of file