xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / tests / common.php (eb72cf0ff00786bb6d7e2da691a6f0b0b51bc9d6) (1,042B) (mode 100644) [raw]
<?php
$INC = dirname(__FILE__) . "/../inc";
require_once($INC . "/state.inc.php");
require_once($INC . "/sql.inc.php");
require_once($INC . "/struct.inc.php");
require_once($INC . "/fixes.inc.php");

$rg_util_debug = TRUE;

rg_log('rg_event_socket: ' . $rg_event_socket);

rg_sql_app("rg-tests");
$db = rg_sql_open($rg_sql);
if ($db === FALSE) {
	rg_log("Cannot create a database (" . rg_sql_error() . ")!");
	exit(1);
}


// Force debug by setting the settings
$r = rg_state_set($db, 'debug', '1');
if ($r === FALSE) {
	rg_internal_error('Cannot set state (debug var)!');
	exit(1);
}


if (isset($rg_no_db) && $rg_no_db)
	return;


rg_log("Redo schema...");

$r = rg_sql_struct_update($db, 0);
if ($r !== TRUE) {
	rg_log("Cannot create struct (" . rg_sql_error() . ")!");
	exit(1);
}

$r = rg_fixes_update($db);
if ($r !== TRUE) {
	rg_log("Cannot apply fixes!");
	exit(1);
}

$r = rg_sql_struct_parts_update($db);
if ($r !== TRUE) {
	rg_log('Cannot create parts: ' . rg_sql_error());
	exit(1);
}

rg_log("common.php finished");
rg_log('');

Hints

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