Esempio n. 1
0
 /**
  * Set the namespace of this cache.
  *
  * This will also add the Memcache namespace prefix as defined in settings.php
  *
  * @param string $namespace Namespace for cache
  *
  * @return void
  */
 public function setNamespace($namespace = "default")
 {
     $config_prefix = _elgg_services()->config->getVolatile('memcache_namespace_prefix');
     if ($config_prefix) {
         $namespace = $config_prefix . $namespace;
     }
     parent::setNamespace($namespace);
 }
Esempio n. 2
0
 /**
  * Cache the entity in a persisted cache
  *
  * @param ElggSharedMemoryCache $cache       Memcache or null cache
  * @param int                   $last_action Last action time
  *
  * @return void
  * @access private
  * @internal
  */
 public function storeInPersistedCache(\ElggSharedMemoryCache $cache, $last_action = 0)
 {
     $tmp = $this->volatile;
     // don't store volatile data
     $this->volatile = [];
     if ($last_action) {
         $this->attributes['last_action'] = (int) $last_action;
     }
     $cache->save($this->guid, $this);
     $this->volatile = $tmp;
 }
Esempio n. 3
0
 /**
  * Set the namespace of this cache.
  *
  * This will also add the Memcache namespace prefix as defined in settings.php
  *
  * @param string $namespace Namespace for cache
  *
  * @return void
  */
 public function setNamespace($namespace = "default")
 {
     if (isset($this->CONFIG->memcache_namespace_prefix)) {
         $namespace = $this->CONFIG->memcache_namespace_prefix . $namespace;
     }
     parent::setNamespace($namespace);
 }