+$pharFile = \Phar::running();
+if ($pharFile == '') {
+ $cfgFilePath = __DIR__ . '/../data/config.php';
+} else {
+ //remove phar:// from the path
+ $cfgFilePath = substr($pharFile, 7) . '.config.php';
+}
+$GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = false;
+$GLOBALS['phorkie']['suggestSetupCheck'] = false;
+if (file_exists($cfgFilePath)) {
+ $GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = true;
+ require_once $cfgFilePath;
+} else if ($GLOBALS['phorkie']['cfg']['setupcheck']) {
+ $GLOBALS['phorkie']['suggestSetupCheck'] = true;
+}
+
+if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) {
+ $GLOBALS['phorkie']['cfg']['baseurl'] = Tools::detectBaseUrl();
+ if (substr($GLOBALS['phorkie']['cfg']['git']['public'], 0, 9) == '%BASEURL%') {
+ //make autoconfig work
+ $GLOBALS['phorkie']['cfg']['git']['public'] = Tools::fullUrlNoPhar(
+ substr($GLOBALS['phorkie']['cfg']['git']['public'], 9)
+ );
+ }
+}
+
+// Set/Get git commit session variables
+$_SESSION['ipaddr'] = $_SERVER['REMOTE_ADDR'];
+if (!isset($_SESSION['name'])) {
+ $_SESSION['name'] = $GLOBALS['phorkie']['auth']['anonymousName'];