diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-12-21 20:05:27 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-12-21 20:05:27 -0800 |
commit | 9285c8c66c530196399eb05bb5561c3fa5538335 (patch) | |
tree | 7cec68583c01b5b365e7669fefc1adc6360e89a5 /system/libraries/drivers | |
parent | 9c5df1d31bd214fab051b71d092c751a1da20ecc (diff) |
Updated Kohana to r4724
Diffstat (limited to 'system/libraries/drivers')
-rw-r--r-- | system/libraries/drivers/Cache/File.php | 4 | ||||
-rw-r--r-- | system/libraries/drivers/Cache/Memcache.php | 7 | ||||
-rw-r--r-- | system/libraries/drivers/Cache/Xcache.php | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/system/libraries/drivers/Cache/File.php b/system/libraries/drivers/Cache/File.php index fc20c22d..d6ec0378 100644 --- a/system/libraries/drivers/Cache/File.php +++ b/system/libraries/drivers/Cache/File.php @@ -183,7 +183,7 @@ class Cache_File_Driver extends Cache_Driver { // Get the id from the filename list($key, $junk) = explode('~', basename($path), 2); - if (($data = $this->get($key)) !== FALSE) + if (($data = $this->get($key, TRUE)) !== FALSE) { // Add the result to the array $result[$key] = $data; @@ -211,7 +211,7 @@ class Cache_File_Driver extends Cache_Driver { // Remove the cache file if ( ! unlink($path)) { - Kohana::log('error', 'Cache: Unable to delete cache file: '.$path); + Kohana_Log::add('error', 'Cache: Unable to delete cache file: '.$path); $success = FALSE; } } diff --git a/system/libraries/drivers/Cache/Memcache.php b/system/libraries/drivers/Cache/Memcache.php index 636191d4..13d61d82 100644 --- a/system/libraries/drivers/Cache/Memcache.php +++ b/system/libraries/drivers/Cache/Memcache.php @@ -17,7 +17,7 @@ class Cache_Memcache_Driver extends Cache_Driver { public function __construct($config) { if ( ! extension_loaded('memcache')) - throw new Kohana_Exception('The memcache PHP extension must be loaded to use this driver.'); + throw new Cache_Exception('The memcache PHP extension must be loaded to use this driver.'); ini_set('memcache.allow_failover', (isset($config['allow_failover']) AND $config['allow_failover']) ? TRUE : FALSE); @@ -79,7 +79,10 @@ class Cache_Memcache_Driver extends Cache_Driver { if ($single) { - return ($items === FALSE OR count($items) > 0) ? current($items) : NULL; + if ($items === FALSE) + return NULL; + + return (count($items) > 0) ? current($items) : NULL; } else { diff --git a/system/libraries/drivers/Cache/Xcache.php b/system/libraries/drivers/Cache/Xcache.php index ad11e6d7..4c08405e 100644 --- a/system/libraries/drivers/Cache/Xcache.php +++ b/system/libraries/drivers/Cache/Xcache.php @@ -16,7 +16,7 @@ class Cache_Xcache_Driver extends Cache_Driver { public function __construct($config) { if ( ! extension_loaded('xcache')) - throw new Kohana_Exception('The xcache PHP extension must be loaded to use this driver.'); + throw new Cache_Exception('The xcache PHP extension must be loaded to use this driver.'); $this->config = $config; } |