rebuild to module
This commit is contained in:
30
config/base_db.php
Normal file
30
config/base_db.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
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.
|
||||
*/
|
||||
|
||||
$env = getenv('APP_ENV');
|
||||
if (!$env && defined('APP_ENV')) {
|
||||
$env = APP_ENV;
|
||||
}
|
||||
if (!$env) {
|
||||
$env = 'prod';
|
||||
}
|
||||
|
||||
$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');
|
||||
@@ -31,6 +31,7 @@ require_once __DIR__ . '/../src/App/functions.php';
|
||||
$domainFile = __DIR__ . '/domaindata.php';
|
||||
$settingsFile = __DIR__ . '/settings.php';
|
||||
$configFile = __DIR__ . '/db.php';
|
||||
$baseConfigFile = __DIR__ . '/base_db.php';
|
||||
|
||||
if (file_exists($domainFile)) {
|
||||
require_once $domainFile;
|
||||
@@ -45,10 +46,17 @@ if (file_exists($configFile)) {
|
||||
$dbConfig = require $configFile;
|
||||
}
|
||||
|
||||
// Base DB config (optional)
|
||||
$baseDbConfig = [];
|
||||
if (file_exists($baseConfigFile)) {
|
||||
$baseDbConfig = require $baseConfigFile;
|
||||
}
|
||||
|
||||
// Globales Config Objekt erstellen
|
||||
global $appConfig;
|
||||
$dbEnabled = defined('APP_DB_ENABLED') ? APP_DB_ENABLED : true;
|
||||
$appConfig = new \App\Config($dbConfig, $dbEnabled);
|
||||
$baseDbEnabled = defined('APP_BASE_DB_ENABLED') ? APP_BASE_DB_ENABLED : false;
|
||||
$appConfig = new \App\Config($dbConfig, $dbEnabled, $baseDbConfig, $baseDbEnabled);
|
||||
|
||||
// App initialisieren
|
||||
\App\App::init($appConfig);
|
||||
|
||||
@@ -30,8 +30,8 @@ $pgsql = [
|
||||
// optional: schema/search_path (commonly "public")
|
||||
'schema' => 'public',
|
||||
|
||||
'user' => 'admin',
|
||||
'password' => 'Hc7LAjDBZbXQBoSzDkaV',
|
||||
'user' => 'nexusBasisLive',
|
||||
'password' => 'JNr4REumUDPDjr4S9Lfq',
|
||||
|
||||
'options' => [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
@@ -5,4 +5,7 @@
|
||||
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
|
||||
define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY);
|
||||
define('APP_DB_ENABLED', false); // set true to enable DB connection
|
||||
|
||||
define('APP_DB_DEBUG', false);
|
||||
define('APP_DB_AUTO_INIT', true);
|
||||
define('APP_KEA_DB_VERSION', '2.6.3');
|
||||
define('APP_BASE_DB_ENABLED', true);
|
||||
|
||||
@@ -30,7 +30,7 @@ $pgsql = [
|
||||
// optional: schema/search_path (commonly "public")
|
||||
'schema' => 'public',
|
||||
|
||||
'user' => 'admin',
|
||||
'user' => 'nexusBasisStg',
|
||||
'password' => '8HHtFt9ON6RkmwIS0c7U',
|
||||
|
||||
'options' => [
|
||||
@@ -4,5 +4,8 @@
|
||||
define('APP_DOMAIN_PRIMARY', APP_DOMAIN_NAME);
|
||||
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
|
||||
define('APP_API_BASE', 'https://api.' . APP_DOMAIN_PRIMARY);
|
||||
define('APP_DB_ENABLED', true); // set true to enable DB connection
|
||||
define('APP_DB_ENABLED', false); // legacy default DB disabled (modules handle their own DB)
|
||||
define('APP_DB_DEBUG', true);
|
||||
define('APP_DB_AUTO_INIT', true);
|
||||
define('APP_KEA_DB_VERSION', '2.6.3');
|
||||
define('APP_BASE_DB_ENABLED', true);
|
||||
|
||||
Reference in New Issue
Block a user