This commit is contained in:
13
config/config.php
Normal file
13
config/config.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/domaindata.php';
|
||||
|
||||
$host = $_SERVER['HTTP_HOST'] ?? '';
|
||||
$isCli = PHP_SAPI === 'cli';
|
||||
$isStagingHost = is_string($host) && str_starts_with($host, 'staging.');
|
||||
|
||||
$envDir = $isStagingHost ? __DIR__ . '/staging' : __DIR__ . '/prod';
|
||||
|
||||
require_once $envDir . '/config.php';
|
||||
|
||||
19
config/db.php
Normal file
19
config/db.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
$pdo = null;
|
||||
|
||||
if (!defined('APP_ENV')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dbLoader = __DIR__ . '/' . APP_ENV . '/db.php';
|
||||
|
||||
// The prototype should run without a database. Explicit opt-in keeps the
|
||||
// current concept environment usable while the data layer is still evolving.
|
||||
$enableDb = getenv('APP_ENABLE_DB') === '1';
|
||||
|
||||
if ($enableDb && is_file($dbLoader)) {
|
||||
require_once $dbLoader;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once __DIR__ . "/domaindata.php";
|
||||
require_once dirname(__DIR__) . "/domaindata.php";
|
||||
|
||||
// Umgebung (optional, aber hilfreich für Debugging / Logik)
|
||||
define('APP_ENV', 'prod'); // oder 'prod', 'local', ...
|
||||
@@ -31,4 +31,3 @@ define('MATOMO_SITE_ID', 7);
|
||||
$env = 'prod';
|
||||
$baseUrl = 'https://'.APP_DOMAIN_NAME;
|
||||
$apiBaseUrl = 'https://api.'.APP_DOMAIN_NAME;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once __DIR__ . "/domaindata.php";
|
||||
require_once dirname(__DIR__) . "/domaindata.php";
|
||||
|
||||
// Umgebung (optional, aber hilfreich für Debugging / Logik)
|
||||
define('APP_ENV', 'staging'); // oder 'prod', 'local', ...
|
||||
@@ -33,4 +33,3 @@ define('MATOMO_ENABLED', false);
|
||||
define('MATOMO_SITE_ID', 8);
|
||||
$baseUrl = 'https://'.APP_DOMAIN_PRIMARY;
|
||||
$apiBaseUrl = 'https://api.'.APP_DOMAIN_PRIMARY;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user