Skip to content

Commit

Permalink
Adhering to coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 23, 2012
1 parent 042221b commit 02d222a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Cache/CacheEngine.php
Expand Up @@ -33,7 +33,7 @@ abstract class CacheEngine {
*
* @var string
**/
protected $groupPrefix = null;
protected $_groupPrefix = null;

/**
* Initialize the cache engine
Expand All @@ -51,7 +51,7 @@ public function init($settings = array()) {
);
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();
Expand Down Expand Up @@ -166,8 +166,8 @@ public function key($key) {
}

$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)));
Expand Down
9 changes: 4 additions & 5 deletions lib/Cake/Cache/Engine/FileEngine.php
Expand Up @@ -82,8 +82,8 @@ public function init($settings = array()) {
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();
}
Expand Down Expand Up @@ -288,10 +288,9 @@ public function increment($key, $offset = 1) {
* @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;

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Cache/Engine/MemcacheEngine.php
Expand Up @@ -284,6 +284,6 @@ public function groups() {
* @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);
}
}
1 change: 0 additions & 1 deletion lib/Cake/Cache/Engine/WincacheEngine.php
Expand Up @@ -186,5 +186,4 @@ public function clearGroup($group) {
return $success;
}


}
2 changes: 1 addition & 1 deletion lib/Cake/Cache/Engine/XcacheEngine.php
Expand Up @@ -164,7 +164,7 @@ public function groups() {
* @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);
}

/**
Expand Down

0 comments on commit 02d222a

Please sign in to comment.