hide additional fields and add button to show them
[phorkie.git] / www / raw.php
index 69b5f569719baa4630d872cc9a21bd5975df2f10..8bda11e8fbaeb9b363bb726bf27239ad9de32eef 100644 (file)
@@ -17,5 +17,10 @@ if ($mimetype === null) {
     $mimetype = 'text/plain';
 }
 header('Content-Type: ' . $mimetype);
-readfile($file->path);
+if ($repo->hash === null) {
+    //IIRC readfile is not so memory-intensive for big files
+    readfile($file->getFullPath());
+} else {
+    echo $file->getContent();
+}
 ?>