Wrapper method for expire() call.

@see  Memento\Single\Agent::expire()
@see  Memento\Group\Agent::expire()

@return boolean returns true if the command was successful
509029
public function expire()
    {
        list($key, $groupKey) = $this->getKeys(func_get_args());
        $this->engine->setGroupKey($groupKey);

        if (!$this->engine->isValid($key)) {
            return false;
        }

        return $this->engine->expire($key);
    }
412104
private function checkExpiration()
    {
        if (!$this->hasLifetime) {
            return;
        }

        if (!isset($this->payload['exp']) || !is_numeric($this->payload['exp'])) {
            return $this->state = self::INVALID;
        }

        if ($this->clockSkew <= (new \DateTime())->format('U') - $this->payload['exp']) {
            $this->state = self::EXPIRED;
        }
    }
554896
public function expire($key, $seconds)
    {
        $this->init();
        $result = $this->driver->expire($key, $seconds);
        return (bool)$result;
    }
1010811
public function isExpiredLink()
    {
        if (($sKey = $this->getUpdateId())) {
            $blExpired = oxNew(\OxidEsales\Eshop\Application\Model\User::class)->isExpiredUpdateId($sKey);
        }

        return $blExpired;
    }
974345
public function store(Memento\Key $key, $value, $expires = null, $ttl = null)
    {
        $keyPath = $this->getKeyPath($key);
        $data = serialize($value);

        $cacheFile = $keyPath . DIRECTORY_SEPARATOR . self::FILENAME_CACHE;
        $expiresFile = $this->getExpiresPath($key) . DIRECTORY_SEPARATOR . self::FILENAME_EXPIRES;
        $ttlFile = $this->getTtlPath($key) . DIRECTORY_SEPARATOR . self::FILENAME_TTL;

        // if no expires specified use default of 5 minutes
        if (!is_numeric($expires)) {
            $expires = self::DEFAULT_EXPIRES;
        }
        $expiresBytes = file_put_contents($expiresFile, time() + $expires, LOCK_EX);

        // ttl is when the cache is actually okay for deletion
        if (!is_numeric($ttl)) {
            $ttl = $expires;
        }

        $ttlBytes = file_put_contents($ttlFile, time() + $ttl, LOCK_EX);

        $cacheBytes = file_put_contents($cacheFile, $data, LOCK_EX);

        if ($expiresBytes > 0 && $ttlBytes > 0 && $cacheBytes > 0) {
            return true;
        }

        return false;
    }
698298
public function isCredentialsNonExpired()
    {
        if (true === $this->credentialsExpired) {
            return false;
        }

        if (null !== $this->credentialsExpireAt && $this->credentialsExpireAt->getTimestamp() < time()) {
            return false;
        }

        return true;
    }
1120058
public function expiration($key)
	{
		if (isset($this->data[static::EXPIRE_DATA_KEY][$key]))
		{
			$expiration = array(
				$this->data[static::EXPIRE_DATA_KEY][$key][0] == EXPIRE_ON_REQUEST ? 'EXPIRE_ON_REQUEST' : 'EXPIRE_ON_GET',
				$this->data[static::EXPIRE_DATA_KEY][$key][1] == static::EXPIRE_STATE_NEW ? 'STATE_NEW' : ($this->data[static::EXPIRE_DATA_KEY][$key][1] == static::EXPIRE_STATE_LOADED ? 'STATE_LOADED' : 'STATE_EXPIRED'),
			);
			return $expiration;
		}

		return false;
	}
204723
public function purgeExpired()
    {

        if ($this->sqlInitialized()) {
            if ($this->sql) {
                if ($this->sql->query("
                    DELETE
                        FROM `{$this->table}`
                        WHERE `expire` < NOW()
                ")) {
                    return true;
                }
            }
        }
        return false;
    }
268780
public function expireCache($verbose = false)
    {
        // if first run ...
        if (!$this->_last_expired_at) {
            $this->_last_expired_at = time();
            if ($verbose) {
                echo "First time running cache expiration\n";
            }
        }

        // if current time is lower than the last time ran plust timeout
        if (time() < $this->_last_expired_at + $this->_timeout) {
            if ($verbose) {
                echo "Not checking cache timeouts\n";
            }
            return false;
        }

        if ($verbose) {
            echo "Checking cache timeouts.\n";
        }
        foreach ($this->_prepared_cache as $key => $cache) {
            if (time() > intval($cache["timestamp"]) + $this->_timeout) {
                Model::closeCursor($cache["statement"]);
                unset($this->_prepared_cache[$key]);
            }
        }
        $this->_last_expired_at = time();
        return true;
    }
1191070
public function getIsExpired()
    {
        $expirationDuration = $this->getExpireDuration();
        if (empty($expirationDuration)) {
            return false;
        }

        return (time() >= ($this->createTimestamp + $expirationDuration));
    }
344975
public static function expireCache()
    {
        $handler = eZExpiryHandler::instance();
        $handler->setTimestamp( self::CACHE_SIGNATURE, time() );
        $handler->store();

        self::$wildcardsIndex = null;
    }
990080
public function is_any_expired() : bool {
        if ($this->is_fully_expired()) {
            return true;
        }

        if (!empty($this->get_expired_roles())) {
            return true;
        }

        if ($this->is_default_expired()) {
            return true;
        }

        return false;
    }
268509
public function isExpired()
	{

		if (
			$this->status == self::C_STATUS_WAITING &&
			$this->lifetime != null &&
			$this->lifetime != '0000-00-00 00:00:00' &&
			strtotime($this->lifetime) <= time()
		) {

			return true;
		}

		return false;

	}
889647
private function expiration() {

		if ( isset( $this->expiration ) ) {
			return $this->expiration;
		}

		/**
		 * Filters the expiration.
		 *
		 * @since 1.0.0
		 *
		 * @param int $expiration Expiration in seconds.
		 */
		$this->expiration = (int) apply_filters( self::FILTER_EXPIRATION, 300 );

		return $this->expiration;
	}
200100
public function cleanUp( $expires = 0 )
	{
		$expires	= $expires ? $expires : $this->expires;
		if( !$expires )
			throw new InvalidArgumentException( 'No expire time given or set on construction.' );

		$number	= 0;
		$index	= new DirectoryIterator( $this->path );
		foreach( $index as $entry )
		{
			if( $entry->isDot() || $entry->isDir() )
				continue;
			$pathName	= $entry->getPathname();
			if( substr( $pathName, -7 ) !== ".serial" )
				continue;
			if( $this->isExpired( $pathName, $expires ) )
				$number	+= (int) @unlink( $pathName );
		}
		return $number;
	}
965629
public function setExpire(\DateTime $expire = null)
    {
        $this->_expire = ($expire) ? $expire : null;

        return $this;
    }
1101824
public function passwordExpired()
    {
        // First we'll check the users userAccountControl to see if
        // it contains the 'password does not expire' flag.
        if ($this->getUserAccountControlObject()->has(AccountControl::DONT_EXPIRE_PASSWORD)) {
            return false;
        }

        $lastSet = (int) $this->getPasswordLastSet();

        if ($lastSet === 0) {
            // If the users last set time is zero, the password has
            // been manually expired by an administrator.
            return true;
        }

        // We'll check if we're using the ActiveDirectory schema to retrieve
        // the max password age, as this is an AD-only feature.
        if ($this->schema instanceof ActiveDirectory) {
            $query = $this->query->newInstance();

            // We need to get the root domain object to be able to
            // retrieve the max password age on the domain.
            $rootDomainObject = $query->select($this->schema->maxPasswordAge())
                ->whereHas($this->schema->objectClass())
                ->first();

            $maxPasswordAge = $rootDomainObject->getMaxPasswordAge();

            if (empty($maxPasswordAge)) {
                // There is not a max password age set on the LDAP server.
                return false;
            }

            // convert from 100 nanosecond ticks to seconds
            $maxPasswordAgeSeconds = $maxPasswordAge / 10000000;

            $lastSetUnixEpoch = Utilities::convertWindowsTimeToUnixTime($lastSet);
            $passwordExpiryTime = $lastSetUnixEpoch - $maxPasswordAgeSeconds;

            $expiresAt = (new DateTime())->setTimestamp($passwordExpiryTime);

            // If our current time is greater than the users password
            // expiry time, the users password has expired.
            return (new DateTime())->getTimestamp() >= $expiresAt->getTimestamp();
        }

        return false;
    }