mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-12 06:56:24 +00:00
Removing exception throwing from CacheEngine::gc() and subclasses as it randomly caused errors when using one of the affected engines.
This commit is contained in:
parent
b7e4e46251
commit
c05c9857ac
4 changed files with 4 additions and 22 deletions
|
@ -521,7 +521,7 @@ abstract class CacheEngine {
|
||||||
* Permanently remove all expired and deleted data
|
* Permanently remove all expired and deleted data
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
abstract public function gc();
|
public function gc() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write value for a key into cache
|
* Write value for a key into cache
|
||||||
|
|
9
cake/libs/cache/apc.php
vendored
9
cake/libs/cache/apc.php
vendored
|
@ -114,14 +114,5 @@ class ApcEngine extends CacheEngine {
|
||||||
return apc_clear_cache('user');
|
return apc_clear_cache('user');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Garbage collection not implemented in APC
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @throws BadMethodCallException
|
|
||||||
*/
|
|
||||||
public function gc() {
|
|
||||||
throw new BadMethodCallException(__('Cannot gc() with APC.'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
10
cake/libs/cache/memcache.php
vendored
10
cake/libs/cache/memcache.php
vendored
|
@ -177,16 +177,6 @@ class MemcacheEngine extends CacheEngine {
|
||||||
return $this->__Memcache->flush();
|
return $this->__Memcache->flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Not implemented - Memcache does not provide a native way to do garbage collection
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
* @throws BadMethodCallException
|
|
||||||
*/
|
|
||||||
public function gc() {
|
|
||||||
throw new BadMethodCallException(__('Cannot gc() with Memcache.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connects to a server in connection pool
|
* Connects to a server in connection pool
|
||||||
*
|
*
|
||||||
|
|
5
cake/libs/cache/xcache.php
vendored
5
cake/libs/cache/xcache.php
vendored
|
@ -49,7 +49,8 @@ class XcacheEngine extends CacheEngine {
|
||||||
*/
|
*/
|
||||||
public function init($settings) {
|
public function init($settings) {
|
||||||
parent::init(array_merge(array(
|
parent::init(array_merge(array(
|
||||||
'engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_', 'PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password'
|
'engine' => 'Xcache', 'prefix' => Inflector::slug(APP_DIR) . '_
|
||||||
|
PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'password'
|
||||||
), $settings)
|
), $settings)
|
||||||
);
|
);
|
||||||
return function_exists('xcache_info');
|
return function_exists('xcache_info');
|
||||||
|
@ -63,7 +64,7 @@ class XcacheEngine extends CacheEngine {
|
||||||
* @param integer $duration How long to cache the data, in seconds
|
* @param integer $duration How long to cache the data, in seconds
|
||||||
* @return boolean True if the data was succesfully cached, false on failure
|
* @return boolean True if the data was succesfully cached, false on failure
|
||||||
*/
|
*/
|
||||||
public function write($key, &$value, $duration) {
|
public function write($key, $value, $duration) {
|
||||||
$expires = time() + $duration;
|
$expires = time() + $duration;
|
||||||
xcache_set($key . '_expires', $expires, $duration);
|
xcache_set($key . '_expires', $expires, $duration);
|
||||||
return xcache_set($key, $value, $duration);
|
return xcache_set($key, $value, $duration);
|
||||||
|
|
Loading…
Add table
Reference in a new issue