Set expire_method

@param string $expire_method
@return Site
332544
public function setExpireMethod($expire_method)
    {
        $expire_method = strtoupper($expire_method);
        if (!isset(self::getExpungeMethods()[$expire_method])) { 
            throw new \InvalidArgumentException(sprintf('The "%s" expire method is not a valid expire method.', $expire_method));
        }
        $this->expire_method = $expire_method;
        return $this;
    }
1120372
public function expire()
    {
        if ($this->isFresh()) {
            $this->headers->set('Age', $this->getMaxAge());
            $this->headers->remove('Expires');
        }

        return $this;
    }
573214
public function set(string $value, int $expire = 0): bool
    {
        return parent::setString($value, $expire);
    }
1298505
function set($key, $data, $expire = 0)
    {
        return $this->connection->set($key, $data, MEMCACHE_COMPRESSED, $expire);
    }
797121
public function expire($expire = 0)
    {
        $var = null;
        $var = substr($expire, 0, 1);

        if (in_array($var, ['+', '-'])) {
            $this->expire = strtotime($expire);

            if ($this->expire === false) {
                throw new \InvalidCookieException(
                    'Cookie->setExpire was passed a string it could not parse - "'.$expire.'"'
                );
            }

            return $this;
        }

        $this->expire = 0;

        return $this;
    }
1190644
public function expire($expire)
    {
        if (is_null($expire)) {
            $this->expire = null;
        } elseif (is_numeric($expire) || $expire instanceof DateInterval) {
            $this->expiresAfter($expire);
        } elseif ($expire instanceof DateTimeInterface) {
            $this->expire = $expire;
        } else {
            throw new InvalidArgumentException('not support datetime');
        }

        return $this;
    }
391
public static function set($key, $value, $expire = 0) {
        try {
            self::getCache()->set($key, $value, $expire);
            self::release();
        } catch (\RuntimeException $e) {
            self::release();
            throw $e;
        } catch (\Error $e) {
            self::release();
            throw $e;
        }
    }
766301
public function setExpire($expire)
	{
		if (null !== $expire)
		{
			$this->expire = $expire instanceof \DateTime ? $expire->getTimestamp() : (int) $expire;
		}
		else
		{
			$this->expire = $expire;
		}

		return $this;
	}
1153876
public function setAsCache(DateTimeObject $expirationDate)
    {
        $expirationDateFormatted = date('D, d M Y H:i:s', $expirationDate->getTimestamp());

        $this->cacheControl->key('Expires', $expirationDateFormatted . ' GMT');

        $maxAge = $expirationDate->getTimestamp() - time();
        $this->cacheControl->key('Cache-Control', 'private, max-age=' . $maxAge);
        $this->cacheControl->key('Last-Modified', date('D, d M Y H:i:s') . ' GMT');

        return $this;
    }
473732
public static function set($key, $value = null, $expiration = null)
    {
        if (!self::$instance) {
            return null;
        }

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

        return self::$instance;
    }
121917
public function set($key, $value, $expire = 0)
    {
        $value = json_encode($value, JSON_UNESCAPED_UNICODE);
        if ($expire > 0) {
            return $this->hash($key)->setex($key, $expire, $value);
        } else {
            return $this->hash($key)->set($key, $value);
        }
    }
983231
public function openCache($expire = 3600) {
        $this->allowCache = $expire !== false;
        $this->cacheLife = $expire;
        return $this;
    }
1097944
private static function withExpires(
        ResponseInterface $response,
        CacheUtil $util,
        string $expires
    ): ResponseInterface {
        $expires = new DateTime($expires);
        $cacheControl = ResponseCacheControl::fromString($response->getHeaderLine('Cache-Control'))
            ->withMaxAge($expires->getTimestamp() - time());

        $response = $util->withExpires($response, $expires);

        return $util->withCacheControl($response, $cacheControl);
    }
474271
public static function set( $key, $value, $expire = 0 ) {
		
		// set the expire date 
		if ( $expire > 0 ) {
			
			if ( $expire < time() ) {
				$expire = time() + $expire;
			}
		}
		
		CCServer::$_instance->COOKIE[$key] = $value;
		
		/*
		 * Finally set the cookie
		 * @toDo: just at the cookie to an array an set the set cookie header from the CCResponse
		 */
		return setcookie( 
			$key, 
			$value, 
			$expire, 
			static::$path, 
			static::$domain, 
			static::$secure, 
			static::$httponly 
		);
	}
547489
public function setExpiry(?\DateTimeImmutable $expiry = null): void
    {
        $date = new \DateTimeImmutable();
        $expiry = $expiry ?: $date;

        $this->setHeader('Date', $date->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));
        $this->setHeader('Expires', $expiry->setTimezone(new \DateTimeZone('UTC'))->format('D, d M Y H:i:s \G\M\T'));

        if ($expiry <= $date) {
            $this->setHeader('Cache-Control', 'no-cache, no-store, must-revalidate, max-age=0');

            return;
        }

        $maxAge = $expiry->getTimestamp() - $date->getTimestamp();
        $this->setHeader('Cache-Control', 'public, max-age=' . $maxAge);
    }
1305835
public function setExpirationDate($expirationDate, $format = '')
    {
        try {
            if (is_string($expirationDate) && $format) {
                $date = \DateTime::createFromFormat($format, $expirationDate);
            } else if (is_string($expirationDate) && !$format) {
                $date = new \DateTime($expirationDate);
            } else {
                $date = $expirationDate;
            }
        } catch (\Exception $e) {
            throw new InvalidExpirationDateException($e->getMessage(), $e->getCode(), $e);
        }

        if (null !== $date && !($date instanceof \DateTime)) {
            throw new InvalidExpirationDateException();
        }

        $this->expirationDate = $date;

        return $this;
    }
549149
public function setExpungeMethod($expunge_method)
    {
        $expunge_method = strtoupper($expunge_method);
        if (!isset(self::getExpungeMethods()[$expunge_method])) { 
            throw new \InvalidArgumentException(sprintf('The "%s" expunge method is not a valid expunge method.', $expunge_method));
        }
        $this->expunge_method = $expunge_method;
        return $this;
    }