Files
geograsim/App/php/config/app.php
T
Adminator 9a61f55cb1 Atlas: Infrastruktur + Team-Konventionen + Sprachregel Lernarbeit
- Design-System (assets/css/design-system.css) mit 21 Komponenten,
  iPad-Responsive-Breakpoints, Touch-Ziele 36px, Music-Player,
  Glossar-Tooltips
- Templates (sims/template.html + student/teacher-Dashboard)
- Docs: module-interface.md (inkl. 4a Sprachregel, 4b Leichte Sprache,
  4c iPad), content-architecture.md, crash-recovery.md, music-registry.md
- Admin-Infrastruktur: admin-modules.html + api/admin-modules.php
  (Titel, Emoji, Bild, Status, Dauer, Alter pro Modul)
- Inbox-System: _inbox/README.md + _status.md fuer Atlas + Briefings
  an Klima, Glossar, Lehrplan, Fluss
- Zentrale SFX-Pipeline (scripts/generate-sounds.py)
- DALL-E-Bilder: 8 Badges + 5 Glossar-Repraesentationsbilder (Querformat)
- Logo + Inter-Font lokal
- PHP-APIs: admin, glossar, levels, licenses, progress, waypoints,
  assignments, profile, tickets
- Spielsprache entfernt (admin-modules, admin-levels, schueler)
- Landing-Page-Bearbeitungen (Boote sichtbarer, Button-Hintergrund)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 11:51:14 +02:00

55 lines
1.9 KiB
PHP

<?php
/**
* GeoGraSim — App Configuration
* Umgebungserkennung und Grundkonstanten
*/
// Umgebungserkennung via Hostname
$host = $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? 'localhost';
// Docker-Container oder fehlender Host = Production wenn .env.production existiert
$envProdExists = file_exists(dirname(__DIR__, 2) . '/.env.production');
define('IS_PRODUCTION', $host !== 'localhost' || ($envProdExists && !file_exists(dirname(__DIR__, 2) . '/.env.local')));
// BASE_PATH: konfigurierbar per Host
// geograsim.at → /
// staatsgeheimnis.at/geograsim/ → /geograsim
// localhost/geograsim/App/ → /geograsim/App
if (strpos($host, 'geograsim.at') !== false) {
define('BASE_PATH', '');
define('BASE_URL', 'https://geograsim.at');
} elseif (strpos($host, 'staatsgeheimnis.at') !== false) {
define('BASE_PATH', '/geograsim');
define('BASE_URL', 'https://www.staatsgeheimnis.at/geograsim');
} else {
define('BASE_PATH', '/geograsim/App');
define('BASE_URL', 'http://localhost/geograsim/App');
}
define('APP_ROOT', dirname(__DIR__, 2));
// .env laden
$envFile = IS_PRODUCTION
? APP_ROOT . '/.env.production'
: APP_ROOT . '/.env.local';
if (file_exists($envFile)) {
$lines = file($envFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($lines as $line) {
$line = trim($line);
if ($line === '' || $line[0] === '#') continue;
if (strpos($line, '=') === false) continue;
[$key, $value] = explode('=', $line, 2);
$key = trim($key);
$value = trim($value);
if (!defined($key)) {
define($key, $value);
}
}
}
// Defaults fuer lokale Entwicklung (XAMPP)
if (!defined('DB_HOST')) define('DB_HOST', 'localhost');
if (!defined('DB_NAME')) define('DB_NAME', 'geograsim');
if (!defined('DB_USER')) define('DB_USER', 'root');
if (!defined('DB_PASS')) define('DB_PASS', '');
if (!defined('DB_PORT')) define('DB_PORT', '3306');