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