Update demo_mode.php

This commit is contained in:
Roman Kelesidis 2024-02-11 19:50:26 +07:00
commit fd152cf2ef

View file

@ -16,6 +16,7 @@ set_time_limit(600);
global $cron_runtime_log; global $cron_runtime_log;
define('SELECTED_DB', DB()->selected_db);
$dump_path = BB_ROOT . 'install/sql/mysql.sql'; $dump_path = BB_ROOT . 'install/sql/mysql.sql';
if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) { if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) {
@ -25,12 +26,12 @@ if (!IN_DEMO_MODE || !is_file($dump_path) || !is_readable($dump_path)) {
$sql_dump = file_get_contents($dump_path); $sql_dump = file_get_contents($dump_path);
// Delete database // Delete database
if (!DB()->query("DROP DATABASE " . DB()->selected_db)) { if (!DB()->query("DROP DATABASE " . SELECTED_DB)) {
return; return;
} }
// Create database // Create database
if (!DB()->query("CREATE DATABASE " . DB()->selected_db)) { if (!DB()->query("CREATE DATABASE " . SELECTED_DB)) {
return; return;
} }