\n"; exit; } rtrim($photo_str); print $photo_str; file_put_contents($PHOTO_FILE_FULL_PATH , $photo_str); } // Check if cache is still "fresh" if (!file_exists($PHOTO_FILE_FULL_PATH) || time() - filemtime($PHOTO_FILE_FULL_PATH) > $MAX_FILE_AGE) { rebuild_photo_file(); } // Make sure the Cache file was built properly if (!file_exists($PHOTO_FILE_FULL_PATH)) { print "Sorry, I can't find the photo file: '$PHOTO_FILE_FULL_PATH'
\n"; exit; } $tmp_photo = $DOCROOT . $PROJECT_DIR . "/" . $PHOTO_TO_LOAD; // Show the photo, as long as it's actually there if (file_exists($tmp_photo)) { ?>