summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-08-31 14:11:47 +0200
committerAndrey Andreev <narf@devilix.net>2015-08-31 14:11:47 +0200
commit24a4a6ac476b0ca1d47d01fdb8f2b3a6e7b39c24 (patch)
tree28c806f9e6c013ca386b481750d294007c208595
parentbe178a79382cae5079622396f8f9679a15e0f58b (diff)
Fix #4066
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php10
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php14
-rw-r--r--user_guide_src/source/changelog.rst1
3 files changed, 7 insertions, 18 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index 111e2109d..59cf4685d 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -106,7 +106,7 @@ class CI_Cache_memcached extends CI_Driver {
}
else
{
- throw new RuntimeException('Cache: Failed to create Memcache(d) object; extension not loaded?');
+ log_message('error', 'Cache: Failed to create Memcache(d) object; extension not loaded?');
}
foreach ($this->_memcache_conf as $cache_server)
@@ -284,12 +284,6 @@ class CI_Cache_memcached extends CI_Driver {
*/
public function is_supported()
{
- if ( ! extension_loaded('memcached') && ! extension_loaded('memcache'))
- {
- log_message('debug', 'The Memcached Extension must be loaded to use Memcached Cache.');
- return FALSE;
- }
-
- return TRUE;
+ return (extension_loaded('memcached') OR extension_loaded('memcache'));
}
}
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index d7dca1973..2825acfd3 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -115,17 +115,17 @@ class CI_Cache_redis extends CI_Driver
if ( ! $success)
{
- throw new RuntimeException('Cache: Redis connection failed. Check your configuration.');
+ log_message('error', 'Cache: Redis connection failed. Check your configuration.');
}
}
catch (RedisException $e)
{
- throw new RuntimeException('Cache: Redis connection refused ('.$e->getMessage().')');
+ log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')');
}
if (isset($config['password']) && ! $this->_redis->auth($config['password']))
{
- throw new RuntimeException('Cache: Redis authentication failed.');
+ log_message('error', 'Cache: Redis authentication failed.');
}
// Initialize the index of serialized values.
@@ -298,13 +298,7 @@ class CI_Cache_redis extends CI_Driver
*/
public function is_supported()
{
- if ( ! extension_loaded('redis'))
- {
- log_message('debug', 'The Redis extension must be loaded to use Redis cache.');
- return FALSE;
- }
-
- return TRUE;
+ return extension_loaded('redis');
}
// ------------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index b355d8d9e..7c671c0b7 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -20,6 +20,7 @@ Bug fixes for 3.0.2
- Fixed a bug (#4056) - :doc:`Input Library <libraries/input>` method ``get_request_header()`` could not return a value unless ``request_headers()`` was called beforehand.
- Fixed a bug where the :doc:`Database Class <database/index>` entered an endless loop if it fails to connect with the 'sqlsrv' driver.
- Fixed a bug (#4065) - :doc:`Database <database/index>` method ``protect_identifiers()`` treats a traling space as an alias separator if the input doesn't contain ' AS '.
+- Fixed a bug (#4066) - :doc:`Cache Library <libraries/caching>` couldn't fallback to a backup driver if the primary one is Memcache(d) or Redis.
Version 3.0.1
=============