You are here

function shrinktheweb_checkLimitReached in ShrinkTheWeb 8

Same name and namespace in other branches
  1. 6 shrinktheweb.api.inc \shrinktheweb_checkLimitReached()
  2. 7 shrinktheweb.api.inc \shrinktheweb_checkLimitReached()

Check if the limit reached image is existing, if so return true return false if there is no image existing or the limit reached file is older then 6 hours.

Parameters

$sFile:

Return value

bool

1 call to shrinktheweb_checkLimitReached()
shrinktheweb_getCachedThumbnail in ./shrinktheweb.api.inc
Get a thumbnail, caching it first if possible.

File

./shrinktheweb.api.inc, line 620

Code

function shrinktheweb_checkLimitReached($sFile) {

  // File is not existing.
  if (!file_exists($sFile)) {
    return FALSE;
  }

  // Is file older then 6 hours?
  $iCutoff = time() - 3600 * 6;
  if (filemtime($sFile) <= $iCutoff) {
    @unlink($sFile);
    return FALSE;
  }

  // File is existing and not expired!
  return TRUE;
}