Refactor configuration loading: Updated multiple public PHP files to require a new bootstrap file for configuration management. Adjusted paths for product configuration to enhance maintainability and consistency across the application.

This commit is contained in:
smueller
2026-05-22 13:58:30 +02:00
parent ec8686761c
commit 96a5977283
19 changed files with 151 additions and 31 deletions

View File

@@ -3,6 +3,12 @@
* Helper functions for HexaHost.de
*/
$configDir = defined('HEXAHOST_CONFIG_DIR')
? HEXAHOST_CONFIG_DIR
: __DIR__ . '/../config';
require_once $configDir . '/site-config.php';
// Sichere Session-Konfiguration
if (session_status() === PHP_SESSION_NONE) {
// Session-Cookie-Sicherheit
@@ -51,6 +57,11 @@ function includeHeader($title = '', $description = '', $page = '', $scripts = []
$current_page = $page;
$additional_scripts = $scripts;
if (!isset($canonical_url)) {
$requestPath = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/';
$canonical_url = rtrim(getCanonicalBaseUrl(), '/') . $requestPath;
}
include __DIR__ . '/header.php';
}