Puts data into the cache.

@param string $id   The cache id.
@param mixed  $data The cache entry/data.

@return bool TRUE if the entry was successfully stored in the cache, FALSE otherwise.
338545
public function save($id, $data)
    {
        $id = $this->uniqId + '-' + $id;
        if (!$this->apcIsEnabled()) {
            return false;
        }

        if (!$this->contains($id)) {
            if ($this->debug) {
                $this->cache->save($id, $data, 100);
            } else {
                $this->cache->save($id, $data);
            }

            return true;
        }

        return false;
    }
955041
public function update($id, array $data)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id), $data);
    }
164472
public function writeSession($id, $data)
    {
        // exception must be caught in session write handler
        // http://us.php.net/manual/en/function.session-set-save-handler.php
        try {
            $this->db->getCollection($this->sessionCollection)->update(
                ['id' => $id],
                $this->composeFields($id, $data),
                ['upsert' => true]
            );
        } catch (\Exception $e) {
            Yii::$app->errorHandler->handleException($e);
            return false;
        }

        return true;
    }
1255321
public function write($id, $data)
    {
        $this->app['db']
            ->delete(self::TABLENAME)
            ->where('id', $id)
            ->execute();

        return $this->app['db']
            ->insert([
                'id' => $id,
                'access' => time(),
                'session_data' => $data, ])
            ->into(self::TABLENAME)
            ->execute() instanceof PDOStatement;
    }
1168217
public function write($id, $data)
    {
        try {
            $result = $this->db->from($this->table)
                ->where($this->columns['id'])->eq($id)
                ->count();

            if ($result != 0) {
                return (bool) $this->db->update($this->table)
                        ->where($this->columns['id'])->eq($id)
                        ->set(array(
                            $this->columns['data'] => $data,
                            $this->columns['expires'] => time() + $this->maxLifetime,
                ));
            } else {
                return $this->db->insert(array(
                            $this->columns['id'] => $id,
                            $this->columns['data'] => $data,
                            $this->columns['expires'] => time() + $this->maxLifetime
                        ))
                        ->into($this->table);
            }
        } catch (PDOException $e) {
            return false;
        }
    }
1166206
protected function doSave($id, $data, $lifeTime = false)
    {
        if (!$lifeTime) {
            $this->cache->forever($id, $data);
        } else {
            $this->cache->put($id, $data, $lifeTime);
        }

        return true;
    }
170133
public function set($id, $data, $lifeTime = 0)
    {
        if ($lifeTime > (int) 2592000) {
            $lifeTime = time() + $lifeTime;
        }

        return $this->memcache->add($id, $data, CacheFlags::CACHE_COMPRESSED, (int) $lifeTime);
    }
597339
public function write($id, $data)
    {
        return $this->memcached->set($this->prefix . $id, $data, 0, time() + $this->ttl);
    }
1305803
public function update($id, array $data)
    {
        $data = $this->client->put(Inflector::pluralize($this->getResourceName()).'/'.$id, [$this->getResourceName() => $data]);

        return $this->fromArray(reset($data));
    }
746994
public function put($key, $data) {
        if ($this->capacity <= 0) { return false; }
        if (isset($this->hashmap[$key]) && !empty($this->hashmap[$key])) {
            $node = $this->hashmap[$key];
            // update data
            $this->detach($node);
            $this->attach($this->head, $node);
            $node->setData($data);
        }
        else {
            $node = new Node($key, $data);
            $this->hashmap[$key] = $node;
            $this->attach($this->head, $node);

            // check if cache is full
            if (count($this->hashmap) > $this->capacity) {
                // we're full, remove the tail
                $nodeToRemove = $this->tail->getPrevious();
                $this->detach($nodeToRemove);
                unset($this->hashmap[$nodeToRemove->getKey()]);
            }
        }
        return true;
    }
1339351
public function saveById($id, $data)
    {
        $subData = array();
        foreach (array_keys($this->subAttributeList) as $subKey) {
            $subData[$subKey] = null;
            if (isset($data[$subKey])) {
                $subData[$subKey] = $data[$subKey];
                unset($data[$subKey]);
            }
        }
        $id = parent::saveById($id, $data);
        foreach (array_keys($this->subAttributeList) as $subKey) {
            $this->saveSubAttributeById($id, $subKey, $subData[$subKey]);
        }
        return $id;
    }
254688
public function write($id, $data)
    {
        $session = \Doctrine::getTable($this->_tableName)->find($id);
        if (false === $session) {
            $session = new $this->_tableName();
            $session->{$this->_primaryKeyColumn} = $id;
        }

        $session->{$this->_dataColumn} = $data;
        $session->{$this->_lifetimeColumn} = $this->_lifetime;
        $session->{$this->_modifiedColumn} = time();

        if ($session->save()) {
            return true;
        }

        return false;
    }
261875
public function save($id, $data, $ttl = null)
    {
        $filedata = [
            'time' => time(),
            'ttl' => $ttl,
            'data' => $data,
        ];
        return false !== file_put_contents($this->filename($id), json_encode($filedata), LOCK_EX);
    }
1169713
public function store($id, $data = array())
    {
        try {

            if (empty($id)) {
                throw new StorageException('Invalid id parameter.');
            }
            $this->persistence = $this->getPersistence();

            $data = $this->cleanInputData($data);
            if (!$this->exists($id)) {
                $this->insert($id, $data);
            } else {
                $this->update($id, $data);
            }
            return true;

        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }
923803
public function write($id, $data)
    {
        if (!$data) 
            $this->getDbConnection()->executeQuery('DELETE FROM session_data WHERE id=?',[$id]);
            else $this->getDbConnection()->executeQuery('REPLACE INTO session_data SET timestamp=?, id=?, value=?',[time(),$id,$data]);
		return true;
    }
1139421
public function saveById($id, $data)
    {
        $exists = !is_null($id);
        if (!$exists) {
            $id = $this->findAvailableIdByData($data);
        }
        parent::saveById($id, $data);
        return $id;
    }
1233962
public function save($id, $data, $lifeTime = 0)
    {
        return $this->cacheProvider->save($id, $data, $lifeTime);
    }