X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/2b4b34a76f42841e964a549fc64c02ba4f60a3f4..3f0ffc6181c329dd2c1ee05d220b4b82ea907e36:/www/raw.php diff --git a/www/raw.php b/www/raw.php index 69b5f56..bedaa1b 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(); +} ?>