1
0

update statics/books

move apgte to gitlab (dmca)
This commit is contained in:
2018-03-24 02:55:01 +01:00
parent 35c1ea30c7
commit eba2d04272
3 changed files with 22 additions and 8 deletions

View File

@@ -98,4 +98,18 @@ class Books
}
return null;
}
public static function getRepositoryHost($book)
{
$r = $book['repository'];
if (startsWith($r, "http://")) $r = substr($r, strlen("http://"));
if (startsWith($r, "https://")) $r = substr($r, strlen("https://"));
if (startsWith($r, "www.")) $r = substr($r, strlen("www."));
if (startsWith(strtolower($r), "gitlab")) return "Gitlab";
if (startsWith(strtolower($r), "github")) return "Github";
if (startsWith(strtolower($r), "bitbucket")) return "Bitbucket";
return "Online";
}
}