Saves a data in memcached.
Supports tags.

@see \Zend_Cache_Backend_Memcached::save()
10884
public function save($data, $id, $tags = array(), $specificLifetime = false)
    {
        $result = parent::save($data, $id, array(), $specificLifetime);
        if ($tags) {
            if (!method_exists($this->_handle, 'tag_add')) {
                \Zend_Cache::throwException('Method tag_add() is not supported by the PHP memcached extension!');
            }
            foreach ($tags as $tag) {
                $this->_handle->tag_add($tag, $id);
            }
            return true;
        }
        return $result;
    }
105108
public function save()
    {
        try {
            if (isset($this->data['_id'])) {
                $this->data = array_merge($this->data, $this->chill->put($this->_id, $this->data));
            } else {
                $this->data = array_merge($this->data, $this->chill->post($this->data));
            }

            return true;
        } catch (Chill\Exception $ex) {
            return false;
        }
    }
1043393
protected function save()
    {
        $this->db->createCommand()->update($this->tableName, [
            'updated_at' => time(),
            'data' => [serialize($this->_states), \PDO::PARAM_LOB],
            ], ['id' => $this->_id])->execute();
    }
1333116
public function remember($cacheGroup, array $params = [], $tags = null, \Closure $closure = null)
    {
        $data = $this->get($cacheGroup, $params, $tags);

        // Exactly null should be only case we do not accept currently cached data
        if (!is_null($data)) {
            return $data;
        }

        if ($closure) {
            $callbackData = call_user_func($closure);

            if ($callbackData) {
                $this->put($cacheGroup, $params, $callbackData, $tags);
            }

            return $callbackData;
        }
    }
1001981
public function save( string $hash, $data, int $length )
	{
		$this->cache[$hash] = [
			'expires' => time() + $length,
			'data'    => $data,
		];
	}
1277261
protected function saveToCache($data)
    {
        $fh = fopen($this->filePath, 'w');
        if (flock($fh, LOCK_EX)) {
            fwrite($fh, $data);
            flock($fh, LOCK_UN);
        }
        fclose($fh);
        $this->log->debug("Cache file {$this->filePath} saved");
    }
980227
public function save(array $data)
    {
        return (bool) file_put_contents($this->file, $this->serializer->serialize($data));
    }
104239
public function saveInCache($key, $value)
  {
    $this->deleteFromCache($key);
    $this->memcache->set($this->buildMKey($key), serialize($value));
  }
995716
public function save(CacheItemInterface $item)
    {
        $this->connect();

        $ttl = $this->ttl;

        $this->driver->set($item->getKey(), $item->get(), $ttl);

        return (bool) ($this->driver->getResultCode() == \Memcached::RES_SUCCESS);
    }
784830
public function save()
    {
        $keys = array_keys($this->langstrings);
        sort($keys);

        $maxlen       = 0;
        $langPrefixes = array();
        foreach ($keys as $key) {
            $tokens = explode('.', $key);
            if (preg_match('/tl_layout\.[a-z]+\.css\./', $key)) {
                $tokens = array($tokens[0], $tokens[1] . '.' . $tokens[2], $tokens[3]);
            }
            $langPrefix = '$GLOBALS[\'TL_LANG\']';
            foreach ($tokens as $token) {
                $langPrefix .= '[\'' . $token . '\']';
            }

            $langPrefixes[$key] = $langPrefix;

            if (strlen($langPrefix) > $maxlen) {
                $maxlen = strlen($langPrefix);
            }
        }

        $buffer = $this->getHead() . PHP_EOL . PHP_EOL;
        foreach ($keys as $key) {
            $prefix  = $langPrefixes[$key];
            $buffer .= sprintf(
                '%s = %s;' . PHP_EOL,
                $prefix . str_repeat(' ', ($maxlen - strlen($prefix))),
                var_export($this->getValue($key), true)
            );
        }
        $buffer  .= PHP_EOL;
        $resource = fopen($this->filename, 'wb');
        fputs($resource, $buffer);

        fclose($resource);
    }
535095
public function save()
    {
        if ($this->isDirty) {
            $this->backend->save($this->settingsValues);

            $this->isDirty = false;

            Backend\Cache::clearCache();
        }
    }
663694
public function save($data)
	{
		// Check and make sure this is an array of arrays
		if (!is_array($data))
		{
			return false;
		}

		if (isset($data[0]) && is_array($data[0]))
		{
			foreach ($data as $d)
			{
				if (!parent::save($d))
				{
					return false;
				}
			}
		}
		else
		{
			// If not an array of arrays, we'll assume it's just one item to save
			if (!parent::save($data))
			{
				return false;
			}
		}

		return true;
	}
604730
def save(self, key, data):
        
        self._db[key] = json.dumps(data)
        self._db.sync()
1043002
public function save()
    {
        $data = $this->getData();
        if (!$this->currentId)
        {
            $config = $this->config();
            $config->last_id++;

            $this->setField('id', $config->last_id);
            array_push($data, $this->set);

            Helpers\Config::table($this->name)->put($config);
        }
        else
        {
            $this->setField('id', $this->currentId);
            $data[$this->currentKey] = $this->set;
        }

        Helpers\Data::table($this->name)->put($data);

//         $this->setFields();
    }
901519
function store()
    {
        if ( !$this->IsModified )
        {
            return;
        }

        // EZP-23908: Restore timestamps before saving, to reduce chance of race condition issues
        $modifiedTimestamps = $this->Timestamps;
        $this->restore();

        // Apply timestamps that have been added or modified in this process
        foreach ( $modifiedTimestamps as $name => $value )
        {
            if ( $value > self::getTimestamp( $name, 0 ) )
            {
                $this->setTimestamp( $name, $value );
            }
        }

        if ( $this->IsModified )
        {
            $this->CacheFile->storeContents( "<?php\n\$Timestamps = " . var_export( $this->Timestamps, true ) . ";\n?>", 'expirycache', false, true );
            $this->IsModified = false;
        }
    }
691334
public function save()
    {
        $lifetime = $this->_params['lifetime'];

        foreach ($this->_update as $mbox => $val) {
            $s = &$this->_slicemap[$mbox];

            try {
                if (!empty($val['add'])) {
                    if ($s['c'] <= $this->_params['slicesize']) {
                        $val['slice'][] = $s['i'];
                        $this->_loadSlice($mbox, $s['i']);
                    }
                    $val['slicemap'] = true;

                    foreach (array_keys(array_flip($val['add'])) as $uid) {
                        if ($s['c']++ > $this->_params['slicesize']) {
                            $s['c'] = 0;
                            $val['slice'][] = ++$s['i'];
                            $this->_loadSlice($mbox, $s['i']);
                        }
                        $s['s'][$uid] = $s['i'];
                    }
                }

                if (!empty($val['slice'])) {
                    $d = &$this->_data[$mbox];
                    $val['slicemap'] = true;

                    foreach (array_keys(array_flip($val['slice'])) as $slice) {
                        $data = array();
                        foreach (array_keys($s['s'], $slice) as $uid) {
                            $data[$uid] = is_array($d[$uid])
                                ? serialize($d[$uid])
                                : $d[$uid];
                        }
                        $this->_cache->set($this->_getCid($mbox, $slice), serialize($data), $lifetime);
                    }
                }

                if (!empty($val['slicemap'])) {
                    $this->_cache->set($this->_getCid($mbox, 'slicemap'), serialize($s), $lifetime);
                }
            } catch (Horde_Exception $e) {
            }
        }

        $this->_update = array();
    }
680411
public function save($key, $data, $force = false, $ttl = 1440) {
        $ttl = $ttl * 60; // Minutes to Seconds
        // Store result from last query for checking if cache is existing
        // This will avoid locked database error for sqlite3
        $cache_exists = $this->exists($key);

        if (!$cache_exists || $force) {
            $key = $this->_encrypt($key);
            $this->_memcached->set($key, $data, $ttl);
            
            return true;
        }
        
        return false;
    }