Almacena un valor en cache asociado a una clave
@param string $key
@param type $data
@param int $ttl
423923
public function store($key,$data,$ttl=0) {
        //Abro/Creo el archivo en modo lectura/escritura
        $file = fopen($this->getFileName($key),'a+');
        if(!$file){return FALSE;}
        //Consigo un bloqueo exclusivo
        flock($file,LOCK_EX);
        //Trunco el archivo en caso de que existieran datos viejos
        ftruncate($file,0);
        //Serializo los datos y los guardo con una fecha de expiracion , si es 0 se lo deja indefinidamente
        if($ttl != 0){
            $ttl= time() + $ttl;
        }
        $data = $this->preperaData(array($ttl,$data));
        if (fwrite($file,$data)===false) {return FALSE;}
        return fclose($file);
    }
313465
public function set($key, $value, $ttl = 0)
    {
        $this->insertToDatabase($key, $value, $ttl);
        $this->setChain($key, $value, $ttl);

        return $this;
    }
1292307
public function set($key, array $nodes, $ttl)
    {
        $this->read();
        parent::set($key, $nodes, $ttl);

        return $this->write();
    }
98143
protected function writeData($key, $value, $ttl)
    {
        if (!is_numeric($ttl) || $ttl < 0)
            throw new CacheException('TTL invalid: '. $ttl);

        if ($ttl == 0)
            $expiration = "datetime('now', '+100 years')"; // This will make the cache expire after you die, so it's effectively forever.
        else
            $expiration = "datetime('now', '+{$ttl} seconds')";

        return $this->db->queryExec("INSERT OR REPLACE INTO cache (key, value, expire) VALUES ('" . $this->key($key) . "', '".
                                                                                        sqlite_escape_string($value) . "',".
                                                                                        "{$expiration})");
    }
1368202
public function ttl($key, $db = -1)
    {
        if(-1 != $db) {
            $this->execute('select', array($db));
        }

        return $this->execute('ttl', array($key));
    }
1206537
public function set($key, $val, $ttl = null)
    {
        $this->throwInvalidStringArgumentException($key);

        $this->cache[$key] = $val;

        return true;
    }
1257091
public function set($key, $value, $ttl = null)
    {
        return $this->_instance->set($key, $value, $ttl);
    }
157803
public function save($id, $data, $ttl = 60, $raw = FALSE)
	{
		return wincache_ucache_set($id, $data, $ttl);
	}
47309
protected function setCacheFileContent($key, $content, $ttl = 0)
    {
        $result = true;
        $filepath = $this->getCacheFilePath($key);
        $content = serialize($content);
        if (file_put_contents($filepath, $content) === false) {
            $result = false;
        }

        if ($result !== false) {
            $ttl = $ttl + time();
            touch($filepath, $ttl);
        }

        return $result;
    }
1255778
public function set($key, $value, $ttl)
    {
        if (!$this->memcached->set($key, $value, $ttl)) {
            // If set() returns false, that means the key already exists,
            return $this->memcached->replace($key, $value, $ttl);
        } else {
            // set() returned true, so the key has been set successfully
            return true;
        }
    }
1362453
public function store($key, $data, $ttl = 0) {
        if($ttl != 0){
            $ttl= time() + $ttl;
        }
        $data = $this->preperaData(array($ttl,$data));
        $this->delete($key);
        return $this->connection->insert($this->table, array('keyCache' => $key, 'data' => $data));
    }
309292
public function store($key, $value, $ttl = self::DEFAULT_TTL) {
        $this->storage[$key]      =   array('value' => $value, 'expires' => ($ttl) ? time() + $ttl : 0);
        return $value;
    }
846516
public function dump($data, $ttl=null) {

        return $this->getCache()
            ->setNamespace(self::CACHE_NAMESPACE)
            ->set(self::CACHE_NAME, $data, $ttl === null ? self::DEFAULTTTL : intval($ttl));

    }
719020
public function setResult($key, $result, $ttl)
    {
        if (!($ttl instanceof Ttl)) {
            $ttl = new Ttl($ttl);
        }

        $expirationTimestamp = time() + $ttl->getTtl();
        $value = new Value($result, $expirationTimestamp);

        $this->valueStore->set($key, $value, $ttl->getRealTtl());
    }
615311
public function set($key, $value, $ttl = null)
	{
		return $this->_set($key, $value, $ttl, false);
	}
1065536
final public function expireat($key, $ttl) {
		$res = $this->connection->expireat($key, $ttl);
		self::$logger->info(sprintf(
			"Redis: expireat %s: %s.", $key, $ttl));
		return $res;
	}
552716
public function set($key, array $nodes, $ttl)
    {
        $this->records[$key] = ['nodes' => $nodes, 'expire' => time() + $ttl];

        return true;
    }