Skip to content

Commit 5c980a8

Browse files
committed
改进Memcache缓存驱动类
1 parent 6d459f0 commit 5c980a8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Extend/Driver/Cache/CacheMemcache.class.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ function __construct($options=array()) {
2828
if ( !extension_loaded('memcache') ) {
2929
throw_exception(L('_NOT_SUPPERT_').':memcache');
3030
}
31-
if(empty($options)) {
32-
$options = array (
33-
'host' => C('MEMCACHE_HOST') ? C('MEMCACHE_HOST') : '127.0.0.1',
34-
'port' => C('MEMCACHE_PORT') ? C('MEMCACHE_PORT') : 11211,
35-
'timeout' => C('DATA_CACHE_TIMEOUT') ? C('DATA_CACHE_TIMEOUT') : false,
36-
'persistent' => false,
37-
);
38-
}
31+
32+
$options = array_merge(array (
33+
'host' => C('MEMCACHE_HOST') ? C('MEMCACHE_HOST') : '127.0.0.1',
34+
'port' => C('MEMCACHE_PORT') ? C('MEMCACHE_PORT') : 11211,
35+
'timeout' => C('DATA_CACHE_TIMEOUT') ? C('DATA_CACHE_TIMEOUT') : false,
36+
'persistent' => false,
37+
),$options);
38+
3939
$this->options = $options;
4040
$this->options['expire'] = isset($options['expire'])? $options['expire'] : C('DATA_CACHE_TIME');
4141
$this->options['prefix'] = isset($options['prefix'])? $options['prefix'] : C('DATA_CACHE_PREFIX');

0 commit comments

Comments
 (0)