summaryrefslogtreecommitdiff
path: root/demo/plugins/cacheresource.mysql.php
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
committeruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
commitb04486a091558a2b1280e3ee7fb90758e9a32230 (patch)
treeddb15a12dba78e6873a348acd25f872429e210d2 /demo/plugins/cacheresource.mysql.php
parentc59ca44b9ff62a7f54e30409514834a8529780ca (diff)
downloadsmarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.gz
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.bz2
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.zip
- reformat all code for unique style
Diffstat (limited to 'demo/plugins/cacheresource.mysql.php')
-rw-r--r--demo/plugins/cacheresource.mysql.php20
1 files changed, 9 insertions, 11 deletions
diff --git a/demo/plugins/cacheresource.mysql.php b/demo/plugins/cacheresource.mysql.php
index d8d00ab2..027b9376 100644
--- a/demo/plugins/cacheresource.mysql.php
+++ b/demo/plugins/cacheresource.mysql.php
@@ -26,8 +26,11 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
{
// PDO instance
protected $db;
+
protected $fetch;
+
protected $fetchTimestamp;
+
protected $save;
public function __construct()
@@ -62,8 +65,8 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
$row = $this->fetch->fetch();
$this->fetch->closeCursor();
if ($row) {
- $content = $row['content'];
- $mtime = strtotime($row['modified']);
+ $content = $row[ 'content' ];
+ $mtime = strtotime($row[ 'modified' ]);
} else {
$content = null;
$mtime = null;
@@ -105,13 +108,8 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
*/
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();
}
@@ -151,8 +149,8 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
}
// equal test cache_id and match sub-groups
if ($cache_id !== null) {
- $where[] = '(cache_id = ' . $this->db->quote($cache_id)
- . ' OR cache_id LIKE ' . $this->db->quote($cache_id . '|%') . ')';
+ $where[] = '(cache_id = ' . $this->db->quote($cache_id) . ' OR cache_id LIKE ' .
+ $this->db->quote($cache_id . '|%') . ')';
}
// run delete query
$query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where));