c0de.it 2
All checks were successful
Deploy / deploy (push) Successful in 16s

This commit is contained in:
2026-05-15 22:46:38 +02:00
parent 752d33e38a
commit d914a660d8
7 changed files with 41 additions and 15 deletions

View File

@@ -1,8 +1,6 @@
<?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.');
@@ -10,4 +8,3 @@ $isStagingHost = is_string($host) && str_starts_with($host, 'staging.');
$envDir = $isStagingHost ? __DIR__ . '/staging' : __DIR__ . '/prod';
require_once $envDir . '/config.php';

11
config/domainbase.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
if (!defined('APP_PREFIX')) {
define('APP_PREFIX', 'c0de');
}
if (!defined('APP_DOMAIN_BASE')) {
define('APP_DOMAIN_BASE', 'c0de.it');
}

View File

@@ -1,4 +0,0 @@
<?php
define('APP_DOMAIN_NAME', 'c0de.it');
define('APP_PREFIX', 'c0de');

View File

@@ -3,7 +3,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once dirname(__DIR__) . "/domaindata.php";
require_once __DIR__ . "/domaindata.php";
// Umgebung (optional, aber hilfreich für Debugging / Logik)
define('APP_ENV', 'prod'); // oder 'prod', 'local', ...
@@ -29,5 +29,5 @@ define('MATOMO_URL', 'https://matomo.my-statistics.info/');
define('MATOMO_ENABLED', true);
define('MATOMO_SITE_ID', 7);
$env = 'prod';
$baseUrl = 'https://'.APP_DOMAIN_NAME;
$apiBaseUrl = 'https://api.'.APP_DOMAIN_NAME;
$baseUrl = 'https://' . APP_DOMAIN_PRIMARY;
$apiBaseUrl = 'https://api.' . APP_DOMAIN_PRIMARY;

View File

@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/domainbase.php';
if (!defined('APP_DOMAIN_NAME')) {
define('APP_DOMAIN_NAME', APP_DOMAIN_BASE);
}

View File

@@ -3,7 +3,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once dirname(__DIR__) . "/domaindata.php";
require_once __DIR__ . "/domaindata.php";
// Umgebung (optional, aber hilfreich für Debugging / Logik)
define('APP_ENV', 'staging'); // oder 'prod', 'local', ...
@@ -15,13 +15,13 @@ if (!defined('ASSET_VERSION')) {
// Domain-Konfiguration (kann pro Umgebung angepasst werden)
if (!defined('APP_DOMAIN_PRIMARY')) {
define('APP_DOMAIN_PRIMARY', 'staging.'.APP_DOMAIN_NAME);
define('APP_DOMAIN_PRIMARY', APP_STAGE_PREFIX . '.' . APP_DOMAIN_NAME);
}
if (!defined('APP_URL_PRIMARY')) {
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
}
if (!defined('APP_DOMAIN_FAKECHECK')) {
define('APP_DOMAIN_FAKECHECK', 'staging.ismyusbfake.com');
define('APP_DOMAIN_FAKECHECK', APP_STAGE_PREFIX . '.ismyusbfake.com');
}
if (!defined('APP_URL_FAKECHECK')) {
define('APP_URL_FAKECHECK', 'https://' . APP_DOMAIN_FAKECHECK);

View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/domainbase.php';
if (!defined('APP_DOMAIN_NAME')) {
define('APP_DOMAIN_NAME', APP_DOMAIN_BASE);
}
if (!defined('APP_STAGE_PREFIX')) {
define('APP_STAGE_PREFIX', 'staging');
}