<?php
require_once($INC . "/util.inc.php");
require_once($INC . "/log.inc.php");
require_once($INC . "/sql.inc.php");
require_once($INC . "/user.inc.php");
require_once($INC . "/repo.inc.php");
require_once($INC . "/bug.inc.php");
require_once($INC . "/keys.inc.php");
require_once($INC . "/prof.inc.php");
require_once($INC . "/watch.inc.php");
/*
* Main entry point
*/
function rg_api($db, $a)
{
rg_prof_start('api');
rg_log_enter('api: a=' . rg_array2string($a));
$ret = array();
while (1) {
$a['cui'] = rg_user_info($db, $a['connect_uid'], '', '');
if ($a['cui']['exists'] != 1) {
$ret = array('error' => 'internal error');
break;
}
if (strncmp($a['cmd'], 'user', 4) == 0) {
$ret = rg_user_api($db, $a);
break;
}
if (strncmp($a['cmd'], 'repo', 4) == 0) {
$ret = rg_repo_api($db, $a);
break;
}
$ret['error'] = 'invalid command';
break;
}
$ret = json_encode($ret, JSON_PRETTY_PRINT) . "\n";
rg_log_exit();
rg_prof_end('api');
return $ret;
}
?>
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master