summaryrefslogtreecommitdiff
path: root/demo/plugins/cacheresource.mysql.php
diff options
context:
space:
mode:
authorSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
committerSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
commit240409578349843bd8467ea6a2083b564baa135d (patch)
tree70c5d4d621d0b2ef394c7d13f445ad471b224da7 /demo/plugins/cacheresource.mysql.php
parentcc4d8fa1a07e18f00951a921041e37c87015dcb2 (diff)
downloadsmarty-240409578349843bd8467ea6a2083b564baa135d.tar.gz
smarty-240409578349843bd8467ea6a2083b564baa135d.tar.bz2
smarty-240409578349843bd8467ea6a2083b564baa135d.zip
Update PSR-2
Diffstat (limited to 'demo/plugins/cacheresource.mysql.php')
-rw-r--r--demo/plugins/cacheresource.mysql.php52
1 files changed, 28 insertions, 24 deletions
diff --git a/demo/plugins/cacheresource.mysql.php b/demo/plugins/cacheresource.mysql.php
index 027b9376..ff8e6f54 100644
--- a/demo/plugins/cacheresource.mysql.php
+++ b/demo/plugins/cacheresource.mysql.php
@@ -43,19 +43,21 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
}
$this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id');
$this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id');
- $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content)
- VALUES (:id, :name, :cache_id, :compile_id, :content)');
+ $this->save = $this->db->prepare(
+ 'REPLACE INTO output_cache (id, name, cache_id, compile_id, content)
+ VALUES (:id, :name, :cache_id, :compile_id, :content)'
+ );
}
/**
* fetch cached content and its modification time from data source
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param string $content cached content
- * @param integer $mtime cache modification timestamp (epoch)
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $content cached content
+ * @param integer $mtime cache modification timestamp (epoch)
*
* @return void
*/
@@ -78,10 +80,10 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
*
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content.
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
*
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
*/
@@ -97,19 +99,21 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
/**
* Save content to cache
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param integer|null $exp_time seconds till expiration time in seconds or null
- * @param string $content content to cache
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration time in seconds or null
+ * @param string $content content to cache
*
* @return boolean success
*/
protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content)
{
- $this->save->execute(array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id,
- 'content' => $content,));
+ $this->save->execute(
+ array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id,
+ 'content' => $content,)
+ );
return !!$this->save->rowCount();
}
@@ -117,10 +121,10 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
/**
* Delete content from cache
*
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param integer|null $exp_time seconds till expiration or null
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration or null
*
* @return integer number of deleted caches
*/