summaryrefslogtreecommitdiffstats
path: root/system/libraries/Cache
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:45 +0100
commitc13b4a6bfe45fc3eeb71aeb27ae0d69ef09580a5 (patch)
treef6740592c8704f1f464453fcfd0d09b4faea809e /system/libraries/Cache
parent51f00ca8f3ba297ac0eec04071bd6aa85968d2ca (diff)
Merge pull request #4525 from masterklavi/memcached_instanceof
Use instanceof instead of get_class() in Cache_memcached
Diffstat (limited to 'system/libraries/Cache')
-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);
}