diff options
Diffstat (limited to 'system/libraries/Cache/drivers/Cache_memcached.php')
-rw-r--r-- | system/libraries/Cache/drivers/Cache_memcached.php | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/system/libraries/Cache/drivers/Cache_memcached.php b/system/libraries/Cache/drivers/Cache_memcached.php index 747842091..f9d578b93 100644 --- a/system/libraries/Cache/drivers/Cache_memcached.php +++ b/system/libraries/Cache/drivers/Cache_memcached.php @@ -2,27 +2,27 @@ /** * CodeIgniter * - * An open source application development framework for PHP 4.3.2 or newer + * An open source application development framework for PHP 5.1.6 or newer * * @package CodeIgniter * @author ExpressionEngine Dev Team - * @copyright Copyright (c) 2006 - 2012 EllisLab, Inc. + * @copyright Copyright (c) 2006 - 2014 EllisLab, Inc. * @license http://codeigniter.com/user_guide/license.html * @link http://codeigniter.com * @since Version 2.0 - * @filesource + * @filesource */ // ------------------------------------------------------------------------ /** - * CodeIgniter Memcached Caching Class + * CodeIgniter Memcached Caching Class * * @package CodeIgniter * @subpackage Libraries * @category Core * @author ExpressionEngine Dev Team - * @link + * @link */ class CI_Cache_memcached extends CI_Driver { @@ -37,18 +37,18 @@ class CI_Cache_memcached extends CI_Driver { ) ); - // ------------------------------------------------------------------------ + // ------------------------------------------------------------------------ /** * Fetch from cache * * @param mixed unique key id * @return mixed data on success/false on failure - */ + */ public function get($id) - { + { $data = $this->_memcached->get($id); - + return (is_array($data)) ? $data[0] : FALSE; } @@ -72,12 +72,12 @@ class CI_Cache_memcached extends CI_Driver { { return $this->_memcached->set($id, array($data, time(), $ttl), 0, $ttl); } - + return FALSE; } // ------------------------------------------------------------------------ - + /** * Delete from Cache * @@ -90,7 +90,7 @@ class CI_Cache_memcached extends CI_Driver { } // ------------------------------------------------------------------------ - + /** * Clean the Cache * @@ -115,7 +115,7 @@ class CI_Cache_memcached extends CI_Driver { } // ------------------------------------------------------------------------ - + /** * Get Cache Metadata * @@ -158,10 +158,10 @@ class CI_Cache_memcached extends CI_Driver { foreach ($CI->config->config['memcached'] as $name => $conf) { $this->_memcache_conf[$name] = $conf; - } - } + } + } } - + $this->_memcached = new Memcached(); foreach ($this->_memcache_conf as $name => $cache_server) @@ -170,7 +170,7 @@ class CI_Cache_memcached extends CI_Driver { { $cache_server['hostname'] = $this->_default_options['default_host']; } - + if ( ! array_key_exists('port', $cache_server)) { $cache_server['port'] = $this->_default_options['default_port']; @@ -201,18 +201,14 @@ class CI_Cache_memcached extends CI_Driver { if ( ! extension_loaded('memcached')) { log_message('error', 'The Memcached Extension must be loaded to use Memcached Cache.'); - return FALSE; } - + $this->_setup_memcached(); return TRUE; } - // ------------------------------------------------------------------------ - } -// End Class /* End of file Cache_memcached.php */ /* Location: ./system/libraries/Cache/drivers/Cache_memcached.php */
\ No newline at end of file |