';
//echo '

';
echo '
Database connection issues
';
/* Make sure script is actually installed */
if(empty(DATABASE_SERVER) && empty(DATABASE_USERNAME) && empty(DATABASE_PASSWORD) && empty(DATABASE_NAME) && !file_exists(ROOT_PATH . 'install/installed')) {
echo '
Empty database configuration file (config.php).
';
echo '
Did you run the installer (/install path) of ' . PRODUCT_NAME . '?
';
} else {
echo '
Our database is having some issues.
';
echo '
We are actively working on fixing the issue.
';
}
//echo '
📜 Read documentation • 📧 Contact support
';
echo '
';
die();
}
/* Mysql profiling */
if(MYSQL_DEBUG) {
self::$database->query("set profiling_history_size=100");
self::$database->query("set profiling=1");
}
self::$database->set_charset('utf8mb4');
self::initialize_helper();
return self::$database;
}
public static function initialize_helper() {
self::$db = new \Altum\Helpers\MysqliDb(self::$database);
self::$db->returnType = 'object';
}
public static function close() {
if(!self::$database) return;
if(MYSQL_DEBUG) {
$result = self::$database->query("show profiles");
while($profile = $result->fetch_object()) {
echo $profile->Query_ID . ' - ' . round($profile->Duration, 10) . ' s - ' . $profile->Query . '