apps/files_trashbin/lib/Expiration.php
/**
	 * Check if given timestamp in expiration range
	 * @param int $timestamp
	 * @param bool $quotaExceeded
	 * @return bool
	 */
Check if given timestamp in expiration range
@param int $timestamp
@param bool $quotaExceeded
@return bool
Check if given timestamp in expiration range @param int $timestamp @param bool $quotaExceeded @return bool
public function isExpired($timestamp, $quotaExceeded = false){
		if (!$this->isEnabled()) {
			return false;
		}
		if ($quotaExceeded && $this->canPurgeToSaveSpace) {
			return true;
		}
		$time = $this->timeFactory->getTime();
		if ($time<$timestamp) {
			return false;
		}
		if ($this->maxAge !== self::NO_OBLIGATION) {
			$maxTimestamp = $time - ($this->maxAge * 86400);
			$isOlderThanMax = $timestamp < $maxTimestamp;
		} else {
			$isOlderThanMax = false;
		}
		if ($this->minAge !== self::NO_OBLIGATION) {
						$minTimestamp = $time - ($this->minAge * 86400);
			$isMinReached = ($timestamp < $minTimestamp) && $quotaExceeded;
		} else {
			$isMinReached = false;
		}
		return $isOlderThanMax || $isMinReached;
	}
public function isExpired ( $ timestamp , $ quotaExceeded = false ) { if ( ! $ this -> isEnabled ( ) ) { return false ; } if ( $ quotaExceeded && $ this -> canPurgeToSaveSpace ) { return true ; } $ time = $ this -> timeFactory -> getTime ( ) ; if ( $ time < $ timestamp ) { return false ; } if ( $ this -> maxAge !== self :: NO_OBLIGATION ) { $ maxTimestamp = $ time - ( $ this -> maxAge * 86400 ) ; $ isOlderThanMax = $ timestamp < $ maxTimestamp ; } else { $ isOlderThanMax = false ; } if ( $ this -> minAge !== self :: NO_OBLIGATION ) { $ minTimestamp = $ time - ( $ this -> minAge * 86400 ) ; $ isMinReached = ( $ timestamp < $ minTimestamp ) && $ quotaExceeded ; } else { $ isMinReached = false ; } return $ isOlderThanMax || $ isMinReached ; }
Check if given timestamp in expiration range
 @param int $timestamp
 @param bool $quotaExceeded
 @return bool
Check if given timestamp in expiration range @param int $timestamp @param bool $quotaExceeded @return bool
// No expiration if disabled // Purge to save space (if allowed) // Never expire dates in future e.g. misconfiguration or negative time // adjustment // Purge as too old // older than Min obligation and we are running out of quota?
