mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-25 07:35:48 -07:00
Update demo_mode.php
This commit is contained in:
parent
e5400ea642
commit
fd152cf2ef
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue