Build value, token & expiration time to be stored in cache file.

@param string $value
@param int    $expire

@return string
962726
protected function wrap($value, $expire)
    {
        $expire = $this->normalizeTime($expire);

        return $expire."\n".serialize($value);
    }
687397
private function setCache(
        string $key, $value, ?int $expires
    ): void {
        $cache = $this->client->getItem($key);
        $cache->set($value);
        $cache->expiresAfter($expires);
        $this->client->save($cache);
    }
1110920
public function set($key, $value, $expire = 0)
    {
        $this->front->set($key, $value, $expire);
        return $this->back->set($key, $value, $expire);
    }
1308219
public function set($key, $value, $expire = 600) {
        $this->redis->setex($this->formatKey($key), $expire, $this->formatValue($value));
    }
773045
public function set($value,  int $expire = 0): bool
    {
        return parent::setString(json($value),  $expire);
    }
573214
public function set(string $value, int $expire = 0): bool
    {
        return parent::setString($value, $expire);
    }
927450
protected function getExpireTime($expire)
    {
        if ($expire instanceof \DateTime) {
            $expire = $expire->getTimestamp() - time();
        }

        return (int) $expire;
    }
785723
public function setRaw(string $value, int $expire = 0): bool
    {
        return parent::setString($value, $expire);
    }
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);
        }
    }
1259513
protected function appendValue($key, $value, $expiration = 0)
    {
        if ($this->redis->exists($key)) {
            $this->redis->append($key, $value);

            return $this->redis->expire($key, $expiration);
        }

        return $this->redis->setex($key, $expiration, $value);
    }
111151
public function add($key, $value, $expiration = null)
    {

        return $this->set($key, $value, $expiration);
    }
1028145
protected function rememberEverythingWithKey(string $key, $value, int $expire = null) {
		return ($content = $this->driver->get($key)) !== false ? $this->unserialize($content) :
			($this->set($key, $value, $expire) ? $this->get($key) : null);
	}
683428
private function setItem($key, $value, $time, $expire)
    {
        $cache_file = $this->createCacheFile($key);
        if ($cache_file === false) {
            return false;
        }

        $cache_data = array('data' => $value, 'time' => $time, 'expire' => $expire);
        $cache_data = json_encode($cache_data);

        $put_result = file_put_contents($cache_file, $cache_data);
        if ($put_result === false) {
            return false;
        }

        return true;
    }
761904
public static function set(string $key, $value = null, int $expiration = 0): ?Cache
    {
        if (!self::$instance) {
            return null;
        }

        self::$instance->engine->set($key, $value, $expiration);

        return self::$instance;
    }
1300805
public function set(string $key, string $value, int $expire): bool {
		$filename = $this->generateFilename($key);
		$data     = "<?php\n//" . sprintf('%012d', $expire) . sprintf('%012d', time()) . $value . "\n?>";
		return $this->filePutContents($filename, $data);
	}
328757
public function set(int $value, int $expire = 0): bool
    {
        return parent::setString(strval($value), $expire);
    }
628150
public function store($key, $value = null, $expiration = 0)
    {
        return $this->set($key, $value, ($expiration ? $expiration : null));
    }