commit changes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user