commit changes

This commit is contained in:
2026-03-03 02:29:04 +01:00
parent e61f9fb889
commit c982cf1b51
7 changed files with 13 additions and 33 deletions

View File

@@ -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;

View File

@@ -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'));

View File

@@ -1,5 +1,4 @@
<?php
define('APP_ENV', 'local');
define('ASSET_VERSION', 'dev-' . date('Ymd-His'));
define('APP_DOMAIN_PRIMARY', APP_DOMAIN_NAME);
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
@@ -9,3 +8,5 @@
define('APP_DB_AUTO_INIT', true);
define('APP_KEA_DB_VERSION', '2.6.3');
define('APP_BASE_DB_ENABLED', true);
define('APP_BASIC_AUTH', false);
define('APP_SEARCH_DEBUG', false);

View File

@@ -1,5 +1,4 @@
<?php
define('APP_ENV', 'local');
define('ASSET_VERSION', 'dev-' . date('Ymd-His'));
define('APP_DOMAIN_PRIMARY', APP_DOMAIN_NAME);
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
@@ -9,3 +8,5 @@
define('APP_DB_AUTO_INIT', true);
define('APP_KEA_DB_VERSION', '2.6.3');
define('APP_BASE_DB_ENABLED', true);
define('APP_BASIC_AUTH', true);
define('APP_SEARCH_DEBUG', true);