Update memcache session data

@param $key
@param $newvars
@param $oldvars

@return bool
518375
public function update($key, $newvars, $oldvars)
    {
        $ts = microtime(true);

        if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 3) {
            $data   = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars));
            $result = $this->memcache->set($key, $data, MEMCACHE_COMPRESSED, $this->lifetime + 60);

            if ($this->debug) {
                $this->debug('set', $key, $data, $result);
            }

            return $result;
        }

        return true;
    }
1344811
public function cache($key, $expires = null) {
        if ($this->getType() !== self::SELECT) {
            return $this;
        }

        $this->_cacheKey = $key;
        $this->_cacheLength = $expires;

        return $this;
    }
1258762
public function update($new_instance, $old_instance)
    {
        $instance = $old_instance;

        // Get vars
        foreach ($new_instance as $k => $i) {
            $instance[$k] = isset($new_instance[$k]) ? strip_tags($new_instance[$k]) : false;
        }

        // Flush current widget cache.
        $this->flush_widget_cache();

        // Get options from cache to renew them.
        $alloptions = wp_cache_get('alloptions', 'options');

        // Delete options.
        if (isset($alloptions[$this->getModel()->getIdentifier()])) {
            delete_option($this->getModel()->getIdentifier());
        }

        // Return new data.
        return $instance;
    }
429498
public function read($key)
    {
        if ($value = $this->memcache->get($key)) {
            $arr = unserialize($value);
            $this->changed = $arr['changed'];
            $this->ip      = $arr['ip'];
            $this->vars    = $arr['vars'];
            $this->key     = $key;
        }

        if ($this->debug) {
            $this->debug('get', $key, $value);
        }

        return $this->vars ?: '';
    }
1168384
private function storeValueInCache($key, $value, $expiration = null)
    {
        $this->cache[$key] = new MemcacheObject($key, serialize($value), $this->normalizeExpirationTime($expiration));
    }
555175
function changekey(array &$var,$old,$new) {
		$keys=array_keys($var);
		$vals=array_values($var);
		$keys[array_search($old,$keys)]=$new;
		$var=array_combine($keys,$vals);
	}
406596
protected function remapRecursively(&$data, $oldKey, $newKey)
    {
        $data->loopThrough(function ($index, $value) use ($data, $oldKey, $newKey) {
            $matches = $this->checkRegexRecursively($value, $oldKey, $index);
            foreach ($matches as $match) {
                $this->remap($data, $match[0], $this->getRegexProperty($match, $newKey));
            }
        });
    }
976708
protected function _fixvars($vars, $oldvars)
    {
        if ($oldvars !== null) {
            $a_oldvars = $this->unserialize($oldvars);
            if (is_array($a_oldvars)) {
                // remove unset keys on oldvars
                foreach ((array)$this->unsets as $var) {
                    if (isset($a_oldvars[$var])) {
                        unset($a_oldvars[$var]);
                    }
                    else {
                        $path = explode('.', $var);
                        $k = array_pop($path);
                        $node = &$this->get_node($path, $a_oldvars);
                        unset($node[$k]);
                    }
                }

                $newvars = $this->serialize(array_merge(
                    (array)$a_oldvars, (array)$this->unserialize($vars)));
            }
            else {
                $newvars = $vars;
            }
        }

        $this->unsets = array();
        return $newvars;
    }
586689
public function add($key, $value, $expiration = 0)
    {
        return $this->memcached ? $this->memcached->add($key, $value, $expiration) : false;
    }
518190
public function set($key, $value, $expire = 0)
    {
        if ($this->type === 1) {
            return $this->memcache->set($key, $value, $expire);
        } else {
            return $this->memcache->set($this->conf['prefix'] . $key, json_encode($value, JSON_UNESCAPED_UNICODE), false, $expire);
        }
    }
395930
protected function write(array $keys, $expire = null)
    {
        foreach ($keys as $k => $v) {
            $k = sha1($k);
            $this->memcache->set($k, $v, 0, $expire);
        }

        return true;
    }
1092184
public static function set($key, $value) {
		$memcache = self::connect();
		$config = \Skeleton\Object\Config::$cache_handler_config;
		$memcache->add($key, $value, false, $config['expire']);
	}
1126788
protected function get_cache($key)
    {
        // no session data in cache (read() returns false)
        if (!$this->key) {
            $cache = null;
        }
        // use internal data for fast requests (up to 0.5 sec.)
        else if ($key == $this->key && (!$this->vars || microtime(true) - $this->start < 0.5)) {
            $cache = $this->vars;
        }
        else { // else read data again
            $cache = $this->read($key);
        }

        return $cache;
    }
1047709
public function update($key, $value, $expire = 0)
    {
        if ($this->type === 1) {
            return $this->memcache->replace($key, $value, $expire);
        } else {
            return $this->memcache->replace($this->conf['prefix'] . $key, json_encode($value, JSON_UNESCAPED_UNICODE), false, $expire);
        }

    }
187420
public function store( $key, $var, $expire = 0 )
    {
        if ( strlen( $key ) > self::MAX_KEY_LENGTH )
        {
            throw new ezcCacheInvalidKeyException( $key, 'Length > ' . self::MAX_KEY_LENGTH . '.' );
        }

        // protect our data by wrapping it in an object
        $data = new ezcCacheMemoryVarStruct( $key, $var, $expire );
        $compressed = ( $this->options->compressed === true ) ? MEMCACHE_COMPRESSED : false;
        return $this->memcache->set( $key, $data, $compressed, $expire );
    }
203632
public function rename($key, $newkey) {
        $keys = [$key, $newkey];
        return $this->returnCommand(['RENAME'], $keys, $keys);
    }
173473
public function set($key, $information) {
        global $USER;
        $this->ensure_session_cache_initialised();
        $information = serialize($information);
        $this->session[$key]= array(self::CACHETIME=>time(), self::CACHEUSERID=>$USER->id, self::CACHEVALUE=>$information);
    }