X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fplimage.php;h=a8113dbb7f239ca47ce5ceb3b6432fe9f4f4ea3f;hb=ac6f41acd95a154ff0893f5e239760e026eb9d2a;hp=05786650955022c3e563b7b83d011f404a66b843;hpb=b1d30e032b19ec59d36caeafba90fe7ca8553d4b;p=platal.git diff --git a/classes/plimage.php b/classes/plimage.php index 0578665..a8113db 100644 --- a/classes/plimage.php +++ b/classes/plimage.php @@ -1,6 +1,6 @@ ts)) { + header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $this->ts) . ' GMT'); + } pl_cached_dynamic_content_headers($this->mime); if (empty($this->data)) { readfile($this->file); @@ -45,7 +49,7 @@ class PlImage { public function path() { if (empty($this->data)) { - return $file; + return $this->file; } else { $name = md5($this->data); $GLOBALS['img' . $name] = $this->data; @@ -68,23 +72,25 @@ class PlImage { return $this->mime; } - public static function fromData($data, $mime, $x = null, $y = null) + public static function fromData($data, $mime, $x = null, $y = null, $ts = null) { $image = new PlImage(); $image->data = $data; $image->mime = $mime; $image->x = $x; $image->y = $y; + $image->ts = $ts; return $image; } - public static function fromFile($path, $mime, $x = null, $y = null) + public static function fromFile($path, $mime, $x = null, $y = null, $ts = null) { $image = new PlImage(); $image->file = $path; $image->mime = $mime; $image->x = $x; $image->y = $y; + $image->ts = $ts; return $image; } }