MatthiasMullie\Scrapbook\Adapters\Apc::expire PHP Method

expire() protected method

Store the expiration time for items we're setting in this request, to work around APC's behavior of only clearing expires per page request.
See also: static::$expires
protected expire ( array | string $key = [], integer $ttl )
$key array | string
$ttl integer
    protected function expire($key = array(), $ttl = 0)
    {
        if ($ttl === 0) {
            // when storing indefinitely, there's no point in keeping it around,
            // it won't just expire
            return;
        }
        // $key can be both string (1 key) or array (multiple)
        $keys = (array) $key;
        $time = time() + $ttl;
        foreach ($keys as $key) {
            $this->expires[$key] = $time;
        }
    }