All pastes #1324388 Raw Edit

xrogaan

public text v1 · immutable
#1324388 ·published 2009-02-01 11:56 UTC
rendered paste body
:100644 100644 42ba320... 0000000... M	src/IDF/Plugin/SyncGit/Serve.phpdiff --git a/src/IDF/Plugin/SyncGit/Serve.php b/src/IDF/Plugin/SyncGit/Serve.phpindex 42ba320..318c074 100644--- a/src/IDF/Plugin/SyncGit/Serve.php+++ b/src/IDF/Plugin/SyncGit/Serve.php@@ -194,9 +194,25 @@ class IDF_Plugin_SyncGit_Serve         exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').                      'git --git-dir=%s init', escapeshellarg($fullpath)),               $out, $res);-        if ($res != 0) {-            throw new Exception(sprintf('Init repository error, exit status %d.', $res));+        self::_execLog($res,$out,sprintf('Init repository error, exit status %d.', $res))+            or throw new Exception(sprintf('Init repository error, exit status %d.', $res));+    }+    +    protected function _execLog($result, $out, $error) {+        if ($result != 0) {+            $date = date('H:i:s M d, Y');+            $out = implode("\n",$out);+            $text = <<<ERE+$date - $error+---------------------------------+$out++ERE;+        +            file_put_contents(Pluf::f('idf_git_serve_log', '/tmp/git-serve.log'),$text,FILE_APPEND|LOCK_EX);+            return false;         }+        return true;     }      /**