<?php
+namespace phorkie;
/**
* Displays a file
*/
-namespace Phorkie;
+$reqWritePermissions = false;
require_once 'www-header.php';
+
$repo = new Repository();
$repo->loadFromRequest();
$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();
+}
?>