From c982cf1b51d39340e0e3f73dc19118c8f3fa61f0 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Tue, 3 Mar 2026 02:29:04 +0100 Subject: [PATCH] commit changes --- config/base_db.php | 26 +++++--------------------- config/config.php | 5 ----- config/prod/settings.php | 3 ++- config/staging/settings.php | 3 ++- public/index.php | 4 ++-- src/App/Database.php | 3 +-- src/App/Search.php | 2 +- 7 files changed, 13 insertions(+), 33 deletions(-) diff --git a/config/base_db.php b/config/base_db.php index 7d7fd8e..58c4921 100644 --- a/config/base_db.php +++ b/config/base_db.php @@ -3,28 +3,12 @@ declare(strict_types=1); /** * Base database for Nexus core (users, settings, modules). - * This uses the environment-specific config in /config/{env}/db_settings_basic.php. + * Sync copies the correct file into /config. */ -$env = getenv('APP_ENV'); -if (!$env && defined('APP_ENV')) { - $env = APP_ENV; -} -if (!$env) { - $env = 'prod'; +$path = __DIR__ . '/db_settings_basic.php'; +if (!file_exists($path)) { + throw new RuntimeException('Missing base DB config: expected config/db_settings_basic.php'); } -$env = strtolower((string)$env); -$candidates = [ - __DIR__ . '/' . $env . '/db_settings_basic.php', - __DIR__ . '/staging/db_settings_basic.php', - __DIR__ . '/prod/db_settings_basic.php', -]; - -foreach ($candidates as $path) { - if (file_exists($path)) { - return require $path; - } -} - -throw new RuntimeException('Missing base DB config: expected config/{env}/db_settings_basic.php'); +return require $path; diff --git a/config/config.php b/config/config.php index 68072b9..c513fc4 100755 --- a/config/config.php +++ b/config/config.php @@ -18,11 +18,6 @@ foreach (['domaindata.php', 'settings.php'] as $cfgFile) { } -// Environment: staging|prod|local (example) -if (!defined('APP_ENV')) { - define('APP_ENV', 'local'); -} - // Asset versioning if (!defined('ASSET_VERSION')) { define('ASSET_VERSION', 'dev-' . date('Ymd-His')); diff --git a/config/prod/settings.php b/config/prod/settings.php index df1ad79..352725a 100755 --- a/config/prod/settings.php +++ b/config/prod/settings.php @@ -1,5 +1,4 @@ getMessage(); } diff --git a/src/App/Search.php b/src/App/Search.php index 1d29d8b..0641323 100755 --- a/src/App/Search.php +++ b/src/App/Search.php @@ -216,7 +216,7 @@ final class Search })); } } - if (defined('APP_ENV') && APP_ENV === 'staging') { + if (defined('APP_SEARCH_DEBUG') && APP_SEARCH_DEBUG) { $logOk = [ 'status' => 'ok', 'sql' => $sql,