The cause and the cause, here no longer tell, directly into the subject of project development, I would like to dedicate to the small partner who likes to study GIT
Project structure:
+ router.php//Routing files
+ app.php//Application files
+ git.php//git operation core files
+ index.php//Entry files
Next, you'll start with a flashback to the GIT server, and first, look at the index.php
$router = new Router;
$app = new app;
$app->gitroot = ' D:\Code\git-demo '//Set git warehouse directory for server-side storage of git warehouse
/get repo info/refs
$router->any ([' Get ', ' head '], '/*\.git/info/refs ', [$app, ' getinforefs ']);
$router->post ('/*\.git/git-[a-z]+-pack ', [$app, ' Command ']);
Access file Contents
$router->any ([' Get ', ' head '], '/*\.git/* ', function () {return false;});
$router->post ('/create ', function () {
echo git::init (' Mine ');
});
$router->run ();