codex update

This commit is contained in:
2025-12-05 01:17:28 +01:00
parent 9dee06cdd6
commit 546146ed4e
14 changed files with 924 additions and 873 deletions

View File

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

View File

@@ -0,0 +1,110 @@
<?php
declare(strict_types=1);
$bootstrapConfig = __DIR__ . '/config.php';
if (is_file($bootstrapConfig)) {
require_once $bootstrapConfig;
}
$overrides = $GLOBALS['EMAILTEMPLATE_OVERRIDES'] ?? [];
$env = (string)($overrides['env'] ?? (defined('APP_ENV') ? APP_ENV : (getenv('APP_ENV') ?: 'local')));
$baseUrl = (string)($overrides['base_url'] ?? (defined('APP_URL_PRIMARY') ? APP_URL_PRIMARY : (getenv('APP_BASE_URL') ?: '')));
$cookieDomainDefault = (string)($overrides['cookie_domain'] ?? ($overrides['auth']['cookie_domain'] ?? (defined('APP_COOKIE_DOMAIN') ? APP_COOKIE_DOMAIN : (defined('APP_DOMAIN_PRIMARY') ? '.' . APP_DOMAIN_PRIMARY : ''))));
$sessionNameDefault = (string)($overrides['session_name'] ?? ($overrides['auth']['session_name'] ?? (defined('APP_COOKIE_PREFIX') ? APP_COOKIE_PREFIX . 'session' : 'et_session')));
$projectDbDefaults = [
'db_host' => getenv('DB_HOST') ?: getenv('DB_TPL_HOST') ?: 'localhost',
'db_name' => getenv('DB_NAME') ?: getenv('DB_TPL_NAME') ?: 'd044ae9e',
'db_user' => getenv('DB_USER') ?: getenv('DB_TPL_USER') ?: 'd044ae9e',
'db_pass' => getenv('DB_PASS') ?: getenv('DB_TPL_PASS') ?: '9BVUn)Töcü@ÖVÜfgO8!J',
'db_charset' => getenv('DB_CHARSET') ?: 'utf8mb4',
'db_port' => (int)(getenv('DB_PORT') ?: 3306),
'prefix' => defined('APP_PREFIX') ? APP_PREFIX . '_' : 'emailtemplate_',
];
$legacyOverrides = [];
if (isset($overrides['project'])) {
$legacyOverrides = $overrides['project'];
} elseif (isset($overrides['templates'])) {
$legacyOverrides = $overrides['templates'];
}
$projectDb = array_replace($projectDbDefaults, $legacyOverrides, $overrides['projectdb'] ?? $overrides['dbsettings'] ?? []);
$cors = $overrides['cors'] ?? (getenv('CORS_ORIGIN') ?: '*');
$authDefaults = [
'session_name' => $sessionNameDefault,
'cookie_domain' => $cookieDomainDefault,
'cookie_secure' => $env === 'prod',
'cookie_httponly' => true,
'cookie_samesite' => 'Lax',
'cookie' => [
'domain' => $cookieDomainDefault,
'secure' => $env === 'prod',
'httponly' => true,
'samesite' => 'Lax',
],
'db' => [
'table' => 'customer_users',
'col_user' => 'email',
'col_pass' => 'password_hash',
'col_name' => 'name',
'col_id' => 'id',
'col_status' => 'is_active',
'active_values' => ['active','1',1],
'legacy' => 'md5',
],
];
$auth = array_replace_recursive($authDefaults, $overrides['auth'] ?? []);
$smtpDefaults = [
'host' => 'smtp.example.com',
'port' => 587,
'user' => 'smtp-user',
'pass' => 'smtp-pass',
'secure' => 'tls',
'from_email' => 'no-reply@example.com',
'from_name' => 'EmailTemplate',
];
$smtp = array_replace($smtpDefaults, $overrides['smtp'] ?? []);
$exportDefaults = [
'api_keys' => ['dev-key-123', 'noch-ein-key'],
];
$export = array_replace_recursive($exportDefaults, $overrides['export'] ?? []);
$multiDefaults = [
'tenant_col' => 'customer_id',
'map_session_to'=> 'id',
];
$multi = array_replace($multiDefaults, $overrides['multi'] ?? []);
$tablesDefaults = [
'templates' => 'emailtemplate_templates',
'sections' => 'emailtemplate_sections',
'blocks' => 'emailtemplate_blocks',
'snippets' => 'emailtemplate_snippets',
];
$tables = array_replace($tablesDefaults, $overrides['tables'] ?? []);
$columnsDefaults = [
'templates' => ['id'=>'id','name'=>'name','desc'=>null,'cat'=>null,'upd'=>'updated_at'],
'sections' => ['id'=>'id','name'=>'name','cat'=>null,'upd'=>'updated_at'],
'blocks' => ['id'=>'id','name'=>'name','cat'=>'category','upd'=>'updated_at'],
'snippets' => ['id'=>'id','name'=>'name','cat'=>'category','upd'=>'updated_at'],
];
$columns = array_replace_recursive($columnsDefaults, $overrides['columns'] ?? []);
return [
'projectdb' => $projectDb,
'cors' => $cors,
'env' => $env,
'base_url' => $baseUrl,
'auth' => $auth,
'smtp' => $smtp,
'export' => $export,
'multi' => $multi,
'tables' => $tables,
'columns' => $columns,
];

View File

@@ -7,6 +7,11 @@
// -----------------------------------------------------------
require_once __DIR__ . "/config.php";
$emailtemplateConfigPath = __DIR__ . '/emailtemplate.conf.php';
if (is_file($emailtemplateConfigPath)) {
$GLOBALS['emailtemplate_config'] = require $emailtemplateConfigPath;
}
// Diese Werte später ins Template schieben:
$GLOBALS['app_env'] = APP_ENV;

View File

@@ -1,16 +1,20 @@
<?php
declare(strict_types=1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/domaindata.php";
// Umgebung (optional, aber hilfreich für Debugging / Logik)
define('APP_ENV', 'prod'); // oder 'prod', 'local', ...
if (!defined('ASSET_VERSION')) {
define('ASSET_VERSION', '2024-11-22'); // oder deine aktuelle Version
$domaindataPath = __DIR__ . '/domaindata.php';
if (!is_file($domaindataPath)) {
$domaindataPath = __DIR__ . '/../domaindata.php';
}
require_once $domaindataPath;
define('APP_ENV', 'prod');
if (!defined('ASSET_VERSION')) {
define('ASSET_VERSION', '2024-11-22');
}
// Domain-Konfiguration (kann pro Umgebung angepasst werden)
if (!defined('APP_DOMAIN_PRIMARY')) {
define('APP_DOMAIN_PRIMARY', APP_DOMAIN_NAME);
}
@@ -24,11 +28,9 @@ if (!defined('APP_URL_FAKECHECK')) {
define('APP_URL_FAKECHECK', 'https://' . APP_DOMAIN_FAKECHECK);
}
// Matomo Einstellungen
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_NAME;
$apiBaseUrl = 'https://api.' . APP_DOMAIN_NAME;

View File

@@ -3,9 +3,9 @@
declare(strict_types=1);
$DB_HOST = 'localhost';
$DB_NAME = 'd0455ede';
$DB_USER = 'd0455ede';
$DB_PASS = 'fF8PhxfCibdLBrSxowIo'; // anpassen
$DB_NAME = 'd04582a5';
$DB_USER = 'd04582a5';
$DB_PASS = 'P§RuDQ2öh/(aiyW3ssPx'; // anpassen
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,

View File

@@ -1,21 +1,24 @@
<?php
declare(strict_types=1);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once __DIR__ . "/domaindata.php";
// Umgebung (optional, aber hilfreich für Debugging / Logik)
define('APP_ENV', 'staging'); // oder 'prod', 'local', ...
$domaindataPath = __DIR__ . '/domaindata.php';
if (!is_file($domaindataPath)) {
$domaindataPath = __DIR__ . '/../domaindata.php';
}
require_once $domaindataPath;
define('APP_ENV', 'staging');
if (!defined('ASSET_VERSION')) {
define('ASSET_VERSION', time()); // oder deine aktuelle Version
define('ASSET_VERSION', time());
}
// Domain-Konfiguration (kann pro Umgebung angepasst werden)
if (!defined('APP_DOMAIN_PRIMARY')) {
define('APP_DOMAIN_PRIMARY', 'staging.'.APP_DOMAIN_NAME);
define('APP_DOMAIN_PRIMARY', 'staging.' . APP_DOMAIN_NAME);
}
if (!defined('APP_URL_PRIMARY')) {
define('APP_URL_PRIMARY', 'https://' . APP_DOMAIN_PRIMARY);
@@ -27,10 +30,9 @@ if (!defined('APP_URL_FAKECHECK')) {
define('APP_URL_FAKECHECK', 'https://' . APP_DOMAIN_FAKECHECK);
}
// Matomo Einstellungen
define('MATOMO_URL', 'https://matomo.my-statistics.info/');
define('MATOMO_ENABLED', false);
define('MATOMO_SITE_ID', 8);
$baseUrl = 'https://'.APP_DOMAIN_PRIMARY;
$apiBaseUrl = 'https://api.'.APP_DOMAIN_PRIMARY;
$baseUrl = 'https://' . APP_DOMAIN_PRIMARY;
$apiBaseUrl = 'https://api.' . APP_DOMAIN_PRIMARY;

View File

@@ -3,9 +3,9 @@
declare(strict_types=1);
$DB_HOST = 'localhost';
$DB_NAME = 'd0455edf';
$DB_USER = 'd0455edf';
$DB_PASS = 'fF8PhxfCibdLBrSxowIo'; // anpassen
$DB_NAME = 'd044ae9e';
$DB_USER = 'd044ae9e';
$DB_PASS = '9BVUn)Töcü@ÖVÜfgO8!J'; // anpassen
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,