git.cweiske.de
/
phorkie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6b6b594
)
gist.github.com forking support
author
Christian Weiske
<cweiske@cweiske.de>
Fri, 21 Sep 2012 17:49:51 +0000
(19:49 +0200)
committer
Christian Weiske
<cweiske@cweiske.de>
Fri, 21 Sep 2012 17:49:51 +0000
(19:49 +0200)
src/phorkie/ForkRemote.php
patch
|
blob
|
history
diff --git
a/src/phorkie/ForkRemote.php
b/src/phorkie/ForkRemote.php
index 524255aca5564184eae44fa65a98c658afc98154..c9ed748ad189f7f841cc2e6e96255e48f3d47b59 100644
(file)
--- a/
src/phorkie/ForkRemote.php
+++ b/
src/phorkie/ForkRemote.php
@@
-22,7
+22,15
@@
class ForkRemote
public function parse()
{
- $scheme = parse_url($this->url, PHP_URL_SCHEME);
+ $arUrl = parse_url($this->url);
+ $scheme = $arUrl['scheme'] ?: '';
+ if ($scheme == 'https' && isset($arUrl['host'])
+ && $arUrl['host'] == 'gist.github.com'
+ ) {
+ $scheme = 'git';
+ $this->url = 'git://gist.github.com/'. ltrim($arUrl['path'], '/') . '.git';
+ }
+
switch ($scheme) {
case 'git':
//clearly a git url