示例#1
0
文件: File.php 项目: indigophp/common
 /**
  * @param string $file
  * @param string $mime
  * @param array  $headers
  */
 public function __construct(\Fuel\FileSystem\File $file, array $headers = [])
 {
     // process the passed data
     if (!$file->exists()) {
         throw new NotFound();
     }
     if (!$file->isReadable()) {
         throw new Forbidden();
     }
     $this->setContentType($file->getMimeType());
     parent::__construct($file, 200, $headers);
 }