3 $CALL_ME_FUNCTIONS["repoadmin"] = "gwvp_gitControlCallMe";
5 //$MENU_ITEMS["20repos"]["text"] = "Repo Admin";
6 //$MENU_ITEMS["20repos"]["link"] = "$BASE_URL/admin/repos";
8 function gwvp_gitControlCallMe()
10 if(isset($_REQUEST["q"])) {
11 $query = $_REQUEST["q"];
12 $qspl = explode("/", $query);
14 if($qspl[0] == "git") {
15 return "gwvp_gitBackendInterface";
25 function gwvp_gitBackendInterface()
27 // we need to quite a bit of parsing in here. The "repo" will always be /git/repo.git
28 // but if we get here from a browser, we need to forward back to a normal repo viewer
29 // the only way i can think of doing this is to check the useragent for the word "git"
30 $agent = "git-unknown";
32 if(isset($_SERVER["HTTP_USER_AGENT"])) {
33 $agent = $_SERVER["HTTP_USER_AGENT"];
34 error_log("in git backend with user agent");
35 if(stristr($agent, "git")!==false) {
41 if(isset($_REQUEST["q"])) {
42 $query = $_REQUEST["q"];
43 $qspl = explode("/", $query);
47 if($isgitagent) echo "GIT: i am a git backened interface for a repo $repo, agent $agent";
48 else echo "NOT GIT: i am a git backened interface for a repo $repo, agent $agent";
51 function gwvp_repoExists($name)
55 if(file_exists("$repo_base/$name.git")) return true;
59 function gwvp_createGitRepo($name)
63 error_log("would create $repo_base/$name.git");