summaryrefslogtreecommitdiff
path: root/system/libraries/drivers/Cache
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/drivers/Cache')
-rw-r--r--system/libraries/drivers/Cache/File.php4
-rw-r--r--system/libraries/drivers/Cache/Memcache.php7
-rw-r--r--system/libraries/drivers/Cache/Xcache.php2
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;
}