CarlosM - 2005-01-08

Currently to get the "Last-Modified:" header value you must check all headers and get its value.

I created on Snoopy class a simple way to get this value just by using: $snoopy->lastmodified

Here's the code:

1. Create a new class variable under /* user definable vars */, maybe after the $status variable:
var $lastmodified = "";

2. On the _httprequest function place the following code BEFORE the line: $this->headers[] = $currentHeader;

//Start of Last-Modified code
if(preg_match("/^Last-Modified:/i",$currentHeader)) {
  preg_match("/^Last-Modified:[ ]+(.*)/i",rtrim($currentHeader),$lastmodified);
  $this->lastmodified = $lastmodified[1];
}
// End of Last-Modified code

3. Then just use $snoopy->lastmodified to get the last modified file date if present on the headers

Carlos