git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
support utf-8 characters in file names
[phorkie.git]
/
www
/
raw.php
diff --git
a/www/raw.php
b/www/raw.php
index 69b5f569719baa4630d872cc9a21bd5975df2f10..605462da41d267184cb522219917ca21a51caccb 100644
(file)
--- a/
www/raw.php
+++ b/
www/raw.php
@@
-1,9
+1,11
@@
<?php
<?php
+namespace phorkie;
/**
* Displays a file
*/
/**
* Displays a file
*/
-
namespace phorki
e;
+
$reqWritePermissions = fals
e;
require_once 'www-header.php';
require_once 'www-header.php';
+
$repo = new Repository();
$repo->loadFromRequest();
$repo = new Repository();
$repo->loadFromRequest();
@@
-17,5
+19,10
@@
if ($mimetype === null) {
$mimetype = 'text/plain';
}
header('Content-Type: ' . $mimetype);
$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();
+}
?>
?>