diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-20 11:57:24 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-20 11:57:24 +0000 |
commit | 4f63f22f5f271c5cac8e7f3ce828f41ebdda5ca4 (patch) | |
tree | 16055c20abefc88b2362564408a6d3c8ce3af7b0 /engine | |
parent | c503885c6f465914f2ef458fa880cf064276afb3 (diff) | |
download | elgg-4f63f22f5f271c5cac8e7f3ce828f41ebdda5ca4.tar.gz elgg-4f63f22f5f271c5cac8e7f3ce828f41ebdda5ca4.tar.bz2 |
Refs #2465 - merged [7007] into trunk from 1.7 branch
git-svn-id: http://code.elgg.org/elgg/trunk@7107 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/classes/ElggMemcache.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/engine/classes/ElggMemcache.php b/engine/classes/ElggMemcache.php index 9f12fb73b..b8be999cd 100644 --- a/engine/classes/ElggMemcache.php +++ b/engine/classes/ElggMemcache.php @@ -48,17 +48,17 @@ class ElggMemcache extends ElggSharedMemoryCache { throw new ConfigurationException(elgg_echo('memcache:noservers')); } - if (is_callable($this->memcache, 'addServer')) { + if (is_callable(array($this->memcache, 'addServer'))) { foreach ($CONFIG->memcache_servers as $server) { if (is_array($server)) { $this->memcache->addServer( $server[0], isset($server[1]) ? $server[1] : 11211, - isset($server[2]) ? $server[2] : true, - isset($server[3]) ? $server[3] : null, + isset($server[2]) ? $server[2] : FALSE, + isset($server[3]) ? $server[3] : 1, isset($server[4]) ? $server[4] : 1, isset($server[5]) ? $server[5] : 15, - isset($server[6]) ? $server[6] : true + isset($server[6]) ? $server[6] : TRUE ); } else { @@ -66,7 +66,10 @@ class ElggMemcache extends ElggSharedMemoryCache { } } } else { - elgg_log(elgg_echo('memcache:noaddserver'), 'ERROR'); + // don't use elgg_echo() here because most of the config hasn't been loaded yet + // and it caches the language, which is hard coded in $CONFIG->language as en. + // overriding it with real values later has no effect because it's already cached. + elgg_log("This version of the PHP memcache API doesn't support multiple servers.", 'ERROR'); $server = $CONFIG->memcache_servers[0]; if (is_array($server)) { @@ -77,7 +80,7 @@ class ElggMemcache extends ElggSharedMemoryCache { } // Get version - $this->version = $this->memcache->getversion(); + $this->version = $this->memcache->getVersion(); if (version_compare($this->version, ElggMemcache::$MINSERVERVERSION, '<')) { throw new ConfigurationException(sprintf(elgg_echo('memcache:versiontoolow'), ElggMemcache::$MINSERVERVERSION, $this->version)); } |