aboutsummaryrefslogtreecommitdiff
path: root/www/display.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-03-26 08:05:46 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-03-26 08:05:46 +0200
commit5f427dd38c8d47711ea73015076bb390761e05dd (patch)
tree023a342befae896020e60581d7efaa91abcdcba4 /www/display.php
parent6d0777840e50ce98f3d96629b4e92bbdccd3001c (diff)
downloadphorkie-5f427dd38c8d47711ea73015076bb390761e05dd.tar.gz
phorkie-5f427dd38c8d47711ea73015076bb390761e05dd.zip
use repository and file classes
Diffstat (limited to 'www/display.php')
-rw-r--r--www/display.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/www/display.php b/www/display.php
index 5bd06bb..b6b7d7f 100644
--- a/www/display.php
+++ b/www/display.php
@@ -1,23 +1,14 @@
<?php
+namespace Phorkie;
/**
* Display paste contents
- *
*/
require_once 'www-header.php';
-if (!isset($_GET['id'])) {
- errout(400, 'Paste ID missing');
-}
-if (!is_numeric($_GET['id'])) {
- errout(400, 'Paste ID not numeric');
-}
-$id = (int)$_GET['id'];
-$repoDir = $GLOBALS['phorkie']['cfg']['repos'] . '/' . $id;
-if (!is_dir($repoDir)) {
- errout(404, 'Paste not found');
-}
+$repo = new Repository();
+$repo->loadFromRequest();
-$files = glob($repoDir . '/*');
+/*
$tplFiles = array();
foreach ($files as $file) {
$tplFile = array();
@@ -28,15 +19,19 @@ foreach ($files as $file) {
$tplFile['raw'] = '/' . $id . '/raw/' . $tplFile['filename'];
$tplFiles[] = $tplFile;
}
+*/
render(
'display',
array(
+ 'repo' => $repo,
+ /*
'description' => file_get_contents($repoDir . '/.git/description'),
'files' => $tplFiles,
'links' => array(
'edit' => '/' . $id . '/edit'
)
+ */
)
);
?>