From f142efd4f77c018b2a0a2530a4601920dc7fdcba Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 8 Nov 2020 21:44:32 +0100 Subject: Get rid of db.php and include config directly in entry points --- ratatoeskr/backend.php | 1 + ratatoeskr/frontend.php | 1 + ratatoeskr/main.php | 2 +- ratatoeskr/setup/create_tables.php | 2 -- ratatoeskr/setup/setup.php | 1 - ratatoeskr/sys/db.php | 15 --------------- ratatoeskr/sys/models.php | 1 - ratatoeskr/sys/plugin_api.php | 1 + 8 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 ratatoeskr/sys/db.php (limited to 'ratatoeskr') diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index 42ed21b..b965689 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -17,6 +17,7 @@ use r7r\cms\sys\Env; use r7r\cms\sys\Esc; use r7r\cms\sys\PasswordHash; +require_once(dirname(__FILE__) . "/config.php"); require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/textprocessors.php"); require_once(dirname(__FILE__) . "/sys/plugin_api.php"); diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php index 5382a5d..09d04d4 100644 --- a/ratatoeskr/frontend.php +++ b/ratatoeskr/frontend.php @@ -14,6 +14,7 @@ use r7r\cms\sys\Env; use r7r\cms\sys\Esc; require_once(dirname(__FILE__) . "/languages.php"); +require_once(dirname(__FILE__) . "/config.php"); require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/textprocessors.php"); diff --git a/ratatoeskr/main.php b/ratatoeskr/main.php index c88cc8b..bb8bdf9 100644 --- a/ratatoeskr/main.php +++ b/ratatoeskr/main.php @@ -17,7 +17,7 @@ if (!defined("CONFIG_FILLED_OUT") || !CONFIG_FILLED_OUT) { } require_once(dirname(__FILE__) . "/vendor/autoload.php"); -require_once(dirname(__FILE__) . "/sys/db.php"); +require_once(dirname(__FILE__) . "/config.php"); require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/init_ste.php"); require_once(dirname(__FILE__) . "/sys/translation.php"); diff --git a/ratatoeskr/setup/create_tables.php b/ratatoeskr/setup/create_tables.php index e16647c..296091e 100644 --- a/ratatoeskr/setup/create_tables.php +++ b/ratatoeskr/setup/create_tables.php @@ -7,8 +7,6 @@ if (!defined("SETUP")) { die(); } -require_once(dirname(__FILE__) . "/../sys/db.php"); - function create_mysql_tables(?Database $db = null): void { $sql_tables = <<