From 02d222a3493e1b4f6895d3563ddb985c98080fdd Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Sun, 22 Apr 2012 20:33:07 -0430 Subject: [PATCH] Adhering to coding standards --- lib/Cake/Cache/CacheEngine.php | 8 ++++---- lib/Cake/Cache/Engine/FileEngine.php | 9 ++++----- lib/Cake/Cache/Engine/MemcacheEngine.php | 2 +- lib/Cake/Cache/Engine/WincacheEngine.php | 1 - lib/Cake/Cache/Engine/XcacheEngine.php | 2 +- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/Cake/Cache/CacheEngine.php b/lib/Cake/Cache/CacheEngine.php index 37fda942a..7b285e041 100644 --- a/lib/Cake/Cache/CacheEngine.php +++ b/lib/Cake/Cache/CacheEngine.php @@ -33,7 +33,7 @@ abstract class CacheEngine { * * @var string **/ - protected $groupPrefix = null; + protected $_groupPrefix = null; /** * Initialize the cache engine @@ -51,7 +51,7 @@ abstract class CacheEngine { ); if (!empty($this->settings['groups'])) { sort($this->settings['groups']); - $this->groupPrefix = str_repeat('%s_', count($this->settings['groups'])); + $this->_groupPrefix = str_repeat('%s_', count($this->settings['groups'])); } if (!is_numeric($this->settings['duration'])) { $this->settings['duration'] = strtotime($this->settings['duration']) - time(); @@ -166,8 +166,8 @@ abstract class CacheEngine { } $prefix = ''; - if (!empty($this->groupPrefix)) { - $prefix = vsprintf($this->groupPrefix, $this->groups()); + if (!empty($this->_groupPrefix)) { + $prefix = vsprintf($this->_groupPrefix, $this->groups()); } $key = Inflector::underscore(str_replace(array(DS, '/', '.'), '_', strval($key))); diff --git a/lib/Cake/Cache/Engine/FileEngine.php b/lib/Cake/Cache/Engine/FileEngine.php index ecc2e2f79..23e043b98 100644 --- a/lib/Cake/Cache/Engine/FileEngine.php +++ b/lib/Cake/Cache/Engine/FileEngine.php @@ -82,8 +82,8 @@ class FileEngine extends CacheEngine { if (substr($this->settings['path'], -1) !== DS) { $this->settings['path'] .= DS; } - if (!empty($this->groupPrefix)) { - $this->groupPrefix = str_replace('_', DS, $this->groupPrefix); + if (!empty($this->_groupPrefix)) { + $this->_groupPrefix = str_replace('_', DS, $this->_groupPrefix); } return $this->_active(); } @@ -288,10 +288,9 @@ class FileEngine extends CacheEngine { * @return boolean true if the cache key could be set, false otherwise */ protected function _setKey($key, $createKey = false) { - $groups = null; - if (!empty($this->groupPrefix)) { - $groups = vsprintf($this->groupPrefix, $this->groups()); + if (!empty($this->_groupPrefix)) { + $groups = vsprintf($this->_groupPrefix, $this->groups()); } $dir = $this->settings['path'] . $groups; diff --git a/lib/Cake/Cache/Engine/MemcacheEngine.php b/lib/Cake/Cache/Engine/MemcacheEngine.php index c50b83959..4f588bf50 100644 --- a/lib/Cake/Cache/Engine/MemcacheEngine.php +++ b/lib/Cake/Cache/Engine/MemcacheEngine.php @@ -284,6 +284,6 @@ class MemcacheEngine extends CacheEngine { * @return boolean success **/ public function clearGroup($group) { - return (bool) $this->_Memcache->increment($this->settings['prefix'] . $group); + return (bool)$this->_Memcache->increment($this->settings['prefix'] . $group); } } diff --git a/lib/Cake/Cache/Engine/WincacheEngine.php b/lib/Cake/Cache/Engine/WincacheEngine.php index 6a189dcc8..6482135c1 100644 --- a/lib/Cake/Cache/Engine/WincacheEngine.php +++ b/lib/Cake/Cache/Engine/WincacheEngine.php @@ -186,5 +186,4 @@ class WincacheEngine extends CacheEngine { return $success; } - } diff --git a/lib/Cake/Cache/Engine/XcacheEngine.php b/lib/Cake/Cache/Engine/XcacheEngine.php index 9bc6be219..35da1810d 100644 --- a/lib/Cake/Cache/Engine/XcacheEngine.php +++ b/lib/Cake/Cache/Engine/XcacheEngine.php @@ -164,7 +164,7 @@ class XcacheEngine extends CacheEngine { * @return boolean success **/ public function clearGroup($group) { - return (bool) xcache_inc($this->settings['prefix'] . $group, 1); + return (bool)xcache_inc($this->settings['prefix'] . $group, 1); } /**