aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/ForkRemote.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-09-18 21:31:49 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-09-18 21:31:49 +0200
commit63575a005e8e2386abb24e97791e18d61e6350fe (patch)
tree7dcf91e9e8cf5c75602b6ea9c6d1a64af129d800 /src/phorkie/ForkRemote.php
parentdca6d8d7b6bb61f303c17905dde4ecbde7ff1da5 (diff)
downloadphorkie-63575a005e8e2386abb24e97791e18d61e6350fe.tar.gz
phorkie-63575a005e8e2386abb24e97791e18d61e6350fe.zip
first work on remote forking
Diffstat (limited to 'src/phorkie/ForkRemote.php')
-rw-r--r--src/phorkie/ForkRemote.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/phorkie/ForkRemote.php b/src/phorkie/ForkRemote.php
new file mode 100644
index 0000000..f3639b2
--- /dev/null
+++ b/src/phorkie/ForkRemote.php
@@ -0,0 +1,42 @@
+<?php
+namespace phorkie;
+
+class ForkRemote
+{
+ protected $url;
+
+ public function __construct($url)
+ {
+ $this->url = $url;
+ }
+
+ public function parse()
+ {
+ $scheme = parse_url($this->url, PHP_URL_SCHEME);
+ switch ($scheme) {
+ case 'git':
+ //clearly a git url
+ $this->gitUrl = $this->url;
+ return true;
+
+ case 'ssh':
+ //FIXME: maybe loosen this when we know how to skip the
+ //"do you trust this server" question of ssh
+ $this->error = 'ssh:// URLs are not supported';
+ return false;
+
+ case 'http':
+ case 'https':
+ return $this->extractUrlsFromHtml($this->url);
+ }
+
+ $this->error = 'Unknown URLs scheme: ' . $scheme;
+ return false;
+ }
+
+ protected function extractUrlsFromHtml($url)
+ {
+ }
+}
+
+?>