/** * Serves a file * @param string $file * @return string */ public function serveFile($file) { $type = MimeType::getType($file); if (!headers_sent()) { header('Content-Type: ' . $type); } if (strpos($type, 'text/html') !== false) { $tmpl = new Templator(); $tmpl->setContent($tmpl->getInclude($file)); return $this->serveCache($tmpl->getDisplay()); } else { self::setCacheMtime(filemtime($file)); return $this->serveCache(file_get_contents($file)); } }
/** * returns the mime type of the thumbnails * * @return a valid mime type */ function getThumbnailMimeType() { if ($this->getThumbnailFormat() == "same") { return $this->getMimeType(); } else { $mimeType = new MimeType(); return $mimeType->getType($this->getThumbnailFormat()); } }