X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/6d0777840e50ce98f3d96629b4e92bbdccd3001c..8fadde4a3b26523b15ff019cafc1b49f9143293f:/www/index.php diff --git a/www/index.php b/www/index.php index 5276bf2..d33604d 100644 --- a/www/index.php +++ b/www/index.php @@ -1,4 +1,5 @@ initRepository(); - file_put_contents($dir . '.git/description', $_POST['description']); - - foreach ($_POST['file'] as $num => $arFile) { - if ($arFile['name'] != '') { - $fname = $arFile['name']; - } else { - $fname = 'phork' . $num . '.' . $arFile['type']; - } - $fpath = $dir . $fname; - file_put_contents($fpath, $arFile['content']); - //fixme: let the class do that when it is able to - $command = $vc->getCommand('add') - ->addArgument($fname) - ->execute(); - } - $command = $vc->getCommand('commit') - ->setOption('message', 'initial paste') - ->execute(); - //redirect to phork - redirect($n); +$repopo = new Repository_Post(); +if ($repopo->process($_POST)) { + redirect($repopo->repo->getLink('display')); } $phork = array( - '1' => array( - 'filename' => '', - 'content' => '', - 'type' => '' - ) + '1' => new File(null, null) ); -render('index', array('file' => $phork, 'description' => '')); +render('index', array('files' => $phork, 'description' => '')); ?> \ No newline at end of file