summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache/drivers/Cache_memcached.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-03-12 11:30:21 +0100
committerAndrey Andreev <narf@devilix.net>2016-03-12 11:30:21 +0100
commitfef66f16148a81d57eb2168fda0502be16258870 (patch)
tree8efcdc53edb5d1b99dd02b1dbe8259d0d416e2c9 /system/libraries/Cache/drivers/Cache_memcached.php
parenta7b75ba90431c2f62d706a221e387f3dd6e65f90 (diff)
parent35d9f36538be2acc86beb060fb54d93f268cf307 (diff)
Merge pull request #4525 from masterklavi/memcached_instanceof
Use instanceof instead of get_class() in Cache_memcached
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_memcached.php')
-rw-r--r--system/libraries/Cache/drivers/Cache_memcached.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php
index 56ab5b85b..df02ca2d0 100644
--- a/system/libraries/Cache/drivers/Cache_memcached.php
+++ b/system/libraries/Cache/drivers/Cache_memcached.php
@@ -116,7 +116,7 @@ class CI_Cache_memcached extends CI_Driver {
isset($cache_server['port']) OR $cache_server['port'] = $defaults['port'];
isset($cache_server['weight']) OR $cache_server['weight'] = $defaults['weight'];
- if (get_class($this->_memcached) === 'Memcache')
+ if ($this->_memcached instanceof Memcache)
{
// Third parameter is persistance and defaults to TRUE.
$this->_memcached->addServer(
@@ -126,7 +126,7 @@ class CI_Cache_memcached extends CI_Driver {
$cache_server['weight']
);
}
- else
+ elseif ($this->_memcached instanceof Memcached)
{
$this->_memcached->addServer(
$cache_server['hostname'],
@@ -170,11 +170,11 @@ class CI_Cache_memcached extends CI_Driver {
$data = array($data, time(), $ttl);
}
- if (get_class($this->_memcached) === 'Memcached')
+ if ($this->_memcached instanceof Memcached)
{
return $this->_memcached->set($id, $data, $ttl);
}
- elseif (get_class($this->_memcached) === 'Memcache')
+ elseif ($this->_memcached instanceof Memcache)
{
return $this->_memcached->set($id, $data, 0, $ttl);
}