Added perl to the list of geshi types
[phorkie.git] / www / raw.php
index 9128770fe7b3ea1a7504204b59372a25e6b4334c..8bda11e8fbaeb9b363bb726bf27239ad9de32eef 100644 (file)
@@ -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();
+}
 ?>