Esempio n. 1
0
 /**
  * Checks if content has changed by the last modified timestamp.
  *
  * HTTP_IF_MODIFIED_SINCE feature
  *
  * @param int $lastModified HTTP Last-Modified Timestamp
  */
 public static function sendLastModified($lastModified = null)
 {
     if (!$lastModified) {
         $lastModified = time();
     }
     $lastModified = gmdate('D, d M Y H:i:s T', (double) $lastModified);
     // Sende Last-Modification time
     header('Last-Modified: ' . $lastModified);
     // Last-Modified Timestamp gefunden
     // => den Browser anweisen, den Cache zu verwenden
     if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $lastModified) {
         self::cleanOutputBuffers();
         header('HTTP/1.1 ' . self::HTTP_NOT_MODIFIED);
         exit;
     }
     self::$sentLastModified = true;
 }