X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/e3757ad55ac7f161d4de11e38fb57166a8ee85f7..6e2db84e2ed034f930afe3abca9142861a799b71:/www/raw.php diff --git a/www/raw.php b/www/raw.php index 9128770..8bda11e 100644 --- a/www/raw.php +++ b/www/raw.php @@ -2,7 +2,7 @@ /** * Displays a file */ -namespace Phorkie; +namespace phorkie; require_once 'www-header.php'; $repo = new Repository(); $repo->loadFromRequest(); @@ -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(); +} ?>