aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/memcache.php
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-06 10:49:21 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-11-06 10:49:21 +0000
commit4acff6b9c106ef73362dbb289fb2fade01c5f24d (patch)
treefdee504fbcb844ffe4cd45ace20951493cebb802 /engine/lib/memcache.php
parente2282f9fb0a1acb521bf8ff2d6e486dd98f56172 (diff)
downloadelgg-4acff6b9c106ef73362dbb289fb2fade01c5f24d.tar.gz
elgg-4acff6b9c106ef73362dbb289fb2fade01c5f24d.tar.bz2
Class hierachy changed to separate shared memory caching
git-svn-id: https://code.elgg.org/elgg/trunk@2410 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/memcache.php')
-rw-r--r--engine/lib/memcache.php19
1 files changed, 6 insertions, 13 deletions
diff --git a/engine/lib/memcache.php b/engine/lib/memcache.php
index 27d8ed015..8afef6302 100644
--- a/engine/lib/memcache.php
+++ b/engine/lib/memcache.php
@@ -16,7 +16,7 @@
* Memcache wrapper class.
* @author Curverider Ltd <info@elgg.com>
*/
- class ElggMemcache extends ElggCache
+ class ElggMemcache extends ElggSharedMemoryCache
{
/**
* Minimum version of memcached needed to run
@@ -25,13 +25,6 @@
private static $MINSERVERVERSION = '1.1.12';
/**
- * Namespace variable used for key
- *
- * @var string
- */
- private $namespace;
-
- /**
* Memcache object
*/
private $memcache;
@@ -62,7 +55,7 @@
{
global $CONFIG;
- $this->namespace = $namespace;
+ $this->setNamespace($namespace);
// Do we have memcache?
if (!class_exists('Memcache'))
@@ -140,7 +133,7 @@
*/
private function make_memcache_key($key)
{
- $prefix = $this->namespace . ":";
+ $prefix = $this->getNamespace() . ":";
if (strlen($prefix.$key)> 250)
$key = md5($key);
@@ -200,19 +193,19 @@
/*private function load_persistent_keylist()
{
- return $this->memcache->get($this->namespace.':keys_so_far');
+ return $this->memcache->get($this->getNamespace().':keys_so_far');
}
private function save_persistent_keylist()
{
$stored = $this->load_persistent_keylist();
if ($stored) $this->keys_so_far = array_merge($this->keys_so_far, $stored);
- return $this->memcache->set($this->namespace.':keys_so_far', $this->keys_so_far, null, 0);
+ return $this->memcache->set($this->getNamespace().':keys_so_far', $this->keys_so_far, null, 0);
}
private function clear_persistent_keylist()
{
- return $this->memcache->delete($this->namespace.':keys_so_far', 0);
+ return $this->memcache->delete($this->getNamespace().':keys_so_far', 0);
}
public function __destruct()