X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/e3757ad55ac7f161d4de11e38fb57166a8ee85f7..ca956a5a5758b8514f15c4828bf26a11a7b66032:/www/raw.php diff --git a/www/raw.php b/www/raw.php index 9128770..605462d 100644 --- a/www/raw.php +++ b/www/raw.php @@ -1,9 +1,11 @@ loadFromRequest(); @@ -17,5 +19,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(); +} ?>