X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/39bd200baed00b5b63cc62ce947ef708710ac81c..d06f9e8ea6cefcfae1ad28bb203a7e4e562820a8:/www/raw.php diff --git a/www/raw.php b/www/raw.php index 28f7c56..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->getFullPath()); +if ($repo->hash === null) { + //IIRC readfile is not so memory-intensive for big files + readfile($file->getFullPath()); +} else { + echo $file->getContent(); +} ?>