74 lines
2.2 KiB
PHP
74 lines
2.2 KiB
PHP
<?php
|
|
|
|
// ---------------------------------------------------
|
|
// Directories
|
|
// ---------------------------------------------------
|
|
define('ROOT', dirname(__FILE__) . "/");
|
|
|
|
if (!file_exists(ROOT.'/config.php')) {
|
|
die('Missing config.php.');
|
|
}
|
|
require_once(ROOT.'/config.php');
|
|
|
|
// PHP 8.1+ makes mysqli throw an exception on connection failure instead of
|
|
// returning false - restore the old behavior so the die() checks below
|
|
// actually get a chance to run and show a real error instead of a blank 500.
|
|
mysqli_report(MYSQLI_REPORT_OFF);
|
|
|
|
$GLOBALS['DB'] = mysqli_connect(
|
|
EBAN_DB_HOST,
|
|
EBAN_DB_USER,
|
|
EBAN_DB_PASSWORD,
|
|
EBAN_DB_NAME
|
|
);
|
|
|
|
// Check Eban DB connection
|
|
if (!$GLOBALS['DB']) {
|
|
die('Main Database Connection error: ' . mysqli_connect_error());
|
|
}
|
|
|
|
|
|
$GLOBALS['SBPP'] = mysqli_connect(
|
|
SBPP_DB_HOST,
|
|
SBPP_DB_USER,
|
|
SBPP_DB_PASSWORD,
|
|
SBPP_DB_NAME);
|
|
|
|
// Check SBPP DB connection
|
|
if (!$GLOBALS['SBPP']) {
|
|
die('SBPP Database Connection error: ' . mysqli_connect_error());
|
|
}
|
|
|
|
$GLOBALS['DB_PLAYTIME'] = mysqli_connect(
|
|
DB_HOST_PLAYTIME,
|
|
DB_USER_PLAYTIME,
|
|
DB_PASSWORD_PLAYTIME,
|
|
DB_NAME_PLAYTIME);
|
|
|
|
// Check Playtime DB connection
|
|
if (!$GLOBALS['DB_PLAYTIME']) {
|
|
die('Playtime Database Connection error: ' . mysqli_connect_error());
|
|
}
|
|
|
|
$GLOBALS['DB_COOKIES'] = mysqli_connect(
|
|
DB_HOST_sqlite_cookies,
|
|
DB_USER_sqlite_cookies,
|
|
DB_PASSWORD_sqlite_cookies,
|
|
DB_NAME_sqlite_cookies);
|
|
|
|
// Check Cookie Cache DB connection
|
|
if (!$GLOBALS['DB_COOKIES']) {
|
|
die('Cookie Cache Database Connection error: ' . mysqli_connect_error());
|
|
}
|
|
|
|
$GLOBALS['SERVER_FORUM_NAME'] = SERVER_FORUM_NAME;
|
|
$GLOBALS['SERVER_FORUM_URL'] = SERVER_FORUM_URL;
|
|
$GLOBALS['SERVER_NAME'] = SERVER_NAME;
|
|
$GLOBALS['STEAM_API_KEY'] = STEAM_API_KEY;
|
|
$GLOBALS['STEAM_GROUP'] = STEAM_GROUP;
|
|
$GLOBALS['SECRET_KEY'] = SECRET_KEY;
|
|
|
|
/* TIME ZONE */
|
|
date_default_timezone_set('UTC');
|
|
?>
|