show public and private git urls if configured
[phorkie.git] / src / phorkie / Repository.php
index fef565655c295a3deda9f2f7d706d66ddfe5334a..6dec015538b788e5b556fbbef66a45bf2302d76c 100644 (file)
@@ -152,6 +152,14 @@ class Repository
         throw new Exception('Unknown link type');
     }
 
+    public function getCloneURL($public = true)
+    {
+        $var = $public ? 'public' : 'private';
+        if (isset($GLOBALS['phorkie']['cfg']['git'][$var])) {
+            return $GLOBALS['phorkie']['cfg']['git'][$var] . $this->id . '/.git';
+        }
+        return null;
+    }
 }
 
 ?>