no error when no description
[phorkie.git] / www / index.php
index 5276bf2c96f6c14f436f34eec566006357317754..5bda39084f0d0a7f2b8f20ca96e8a704714fc88a 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+namespace Phorkie;
 /**
  * Show paste creation form
  *
@@ -17,7 +18,7 @@ if (isset($_POST['file'])) {
     $n = count(glob($repoDir . '/*', GLOB_ONLYDIR));
     $dir = $repoDir . '/' . $n . '/'; 
     mkdir($dir, 0777);//FIXME
-    $vc = new VersionControl_Git($dir);
+    $vc = new \VersionControl_Git($dir);
     $vc->initRepository();
     file_put_contents($dir . '.git/description', $_POST['description']);
 
@@ -36,6 +37,7 @@ if (isset($_POST['file'])) {
     }
     $command = $vc->getCommand('commit')
         ->setOption('message', 'initial paste')
+        ->setOption('author', 'Anonymous <anonymous@phorkie>')
         ->execute();
     //redirect to phork
     redirect($n);