You are here

function shrinktheweb_checkLimitReached in ShrinkTheWeb 6

Same name and namespace in other branches
  1. 8 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

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

File

./shrinktheweb.api.inc, line 432

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;
}