Skip to content

Commit

Permalink
Revert "Forcing bool return"
Browse files Browse the repository at this point in the history
This reverts commit fac95ba.
  • Loading branch information
phpnut committed Dec 15, 2015
1 parent 572ca14 commit 577e1b0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Cache/Cache.php
Expand Up @@ -278,7 +278,7 @@ public static function set($settings = array(), $value = null, $config = 'defaul
* @return void
*/
public static function gc($config = 'default', $expires = null) {
return (bool)static::$_engines[$config]->gc($expires);
static::$_engines[$config]->gc($expires);
}

/**
Expand Down Expand Up @@ -452,7 +452,7 @@ public static function delete($key, $config = 'default') {

$success = static::$_engines[$config]->delete($settings['prefix'] . $key);
static::set(null, $config);
return (bool)$success;
return $success;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/CakeSession.php
Expand Up @@ -143,7 +143,7 @@ class CakeSession {
public static function init($base = null) {
static::$time = time();

if (env('HTTP_USER_AGENT') && !static::$_userAgent) {
if (env('HTTP_USER_AGENT')) {
static::$_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/Datasource/Session/CacheSession.php
Expand Up @@ -83,7 +83,7 @@ public function destroy($id) {
* @return bool Success
*/
public function gc($expires = null) {
return (bool)Cache::gc(Configure::read('Session.handler.config'), $expires);
return Cache::gc(Configure::read('Session.handler.config'), $expires);
}

}
8 changes: 4 additions & 4 deletions lib/Cake/Model/Datasource/Session/DatabaseSession.php
Expand Up @@ -123,9 +123,9 @@ public function write($id, $data) {
'counterCache' => false
);
try {
return (bool)$this->_model->save($record, $options);
return $this->_model->save($record, $options);
} catch (PDOException $e) {
return (bool)$this->_model->save($record, $options);
return $this->_model->save($record, $options);
}
}

Expand All @@ -136,7 +136,7 @@ public function write($id, $data) {
* @return bool True for successful delete, false otherwise.
*/
public function destroy($id) {
return (bool)$this->_model->delete($id);
return $this->_model->delete($id);
}

/**
Expand All @@ -151,7 +151,7 @@ public function gc($expires = null) {
} else {
$expires = time() - $expires;
}
return (bool)$this->_model->deleteAll(array($this->_model->alias . ".expires <" => $expires), false, false);
return $this->_model->deleteAll(array($this->_model->alias . ".expires <" => $expires), false, false);
}

}
Expand Up @@ -12,7 +12,6 @@ public function open() {
}

public function close() {
return true;
}

public function read($id) {
Expand All @@ -22,12 +21,9 @@ public function write($id, $data) {
}

public function destroy($id) {
return true;
}

public function gc($expires = null) {
return true;
}


}
Expand Up @@ -12,7 +12,6 @@ public function open() {
}

public function close() {
return true;
}

public function read($id) {
Expand All @@ -22,11 +21,9 @@ public function write($id, $data) {
}

public function destroy($id) {
return true;
}

public function gc($expires = null) {
return true;
}

}

0 comments on commit 577e1b0

Please sign in to comment.