From 63575a005e8e2386abb24e97791e18d61e6350fe Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 18 Sep 2012 21:31:49 +0200 Subject: first work on remote forking --- src/phorkie/ForkRemote.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/phorkie/ForkRemote.php (limited to 'src') 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 @@ +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) + { + } +} + +?> -- cgit v1.2.3