M0 Einrichtung

This commit is contained in:
2026-07-11 22:24:22 +02:00
parent 6f99e7246d
commit 2e6d79e896
21 changed files with 1246 additions and 22 deletions
+58
View File
@@ -0,0 +1,58 @@
# Lokaler MySQL-Dev-Start
Die Legacy-App kann fuer Entwicklung gegen MySQL laufen. Dafuer gibt es eine
Kompatibilitaetsschicht, die die verwendeten `sqlsrv_*`-Funktionen im Dev-Modus
auf PDO/MySQL abbildet.
## Voraussetzungen
- PHP CLI mit `pdo_mysql`.
- MySQL-Testdatenbank.
- Keine Produktivdaten und keine Produktivpasswoerter im Repository.
In dieser VS-Code-Server-Umgebung wurde PHP lokal unter `.local/` entpackt,
weil `sudo` nicht passwordless verfuegbar war. `.local/` wird von Git ignoriert.
## Umgebungsvariablen
```bash
export APP_DB_DRIVER=mysql
export DB_HOST="example.mysql.host"
export DB_PORT="3306"
export DB_NAME="example_database"
export DB_USER="example_user"
export DB_PASS="example_password"
export DEV_AUTH_EMAIL="admin@test.local"
export DEV_AUTH_NAME="Test Admin"
```
## Testdatenbank initialisieren
```bash
php scripts/init-mysql-dev.php
```
In der aktuellen lokalen Umgebung:
```bash
LD_LIBRARY_PATH="$PWD/.local/php/usr/lib/x86_64-linux-gnu" \
"$PWD/.local/php/usr/bin/php8.3" \
-c "$PWD/.local/php-dev.ini" \
scripts/init-mysql-dev.php
```
## Server starten
```bash
HOST=127.0.0.1 PORT=8080 scripts/run-dev-server.sh
```
Danach ist die App unter `http://127.0.0.1:8080/` erreichbar. In VS Code kann
der Port ueber die Ports-Ansicht weitergeleitet werden.
## Hinweise
- Der Dev-Login umgeht AD/LDAP und nutzt `DEV_AUTH_EMAIL`.
- Die Tabellen werden aus `database/mysql-dev-schema.sql` angelegt.
- Der Dev-Modus ist nur fuer lokale Tests gedacht, nicht fuer Produktion.