summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorJohn Bellone <jb@thunkbrightly.com>2011-08-21 14:54:56 +0200
committerJohn Bellone <jb@thunkbrightly.com>2011-08-21 14:54:56 +0200
commit9e8dc0e1b2175fc79b112d469626c76cc13610e3 (patch)
tree2a24bfcc92c8351c69427f839277e2026237741d /system
parent43194ea1af658914a89ca49aed4dca4617b9c4ff (diff)
Making changes to support other Memcached extension
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index ec2fd216a..405602372 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -153,7 +153,17 @@ class CI_Cache_memcached extends CI_Driver {
}
}
- $this->_memcached = new Memcached();
+ if (class_exists('Memcached')) {
+ $this->_memcached = new Memcached();
+ }
+ else if (class_exists('Memcache')) {
+ $this->_memcached = new Memcache();
+ }
+ else {
+ log_message('error', 'Failed to create object for Memcached Cache; extension not loaded?');
+
+ return FALSE;
+ }
foreach ($this->_memcache_conf as $name => $cache_server)
{
@@ -189,7 +199,7 @@ class CI_Cache_memcached extends CI_Driver {
*/
public function is_supported()
{
- if ( ! extension_loaded('memcached'))
+ if ( ! extension_loaded('memcached') && ! extension_loaded('memcache'))
{
log_message('error', 'The Memcached Extension must be loaded to use Memcached Cache.');