update 20.10.2025
This commit is contained in:
parent
8c11130b5d
commit
a939cd51ef
616 changed files with 84821 additions and 4121 deletions
50
dev/subdomain-optimization-gpt-5-v2/INTEGRATION.md
Normal file
50
dev/subdomain-optimization-gpt-5-v2/INTEGRATION.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# Integration & Reihenfolge
|
||||
|
||||
Wichtig: Bestehende Dateien werden hier NICHT verändert. Die folgenden Schritte beschreiben die geplante Integration.
|
||||
|
||||
## Reihenfolge der Middleware (web-Gruppe)
|
||||
|
||||
Empfohlene Reihenfolge in `App\Http\Kernel` (schematisch):
|
||||
|
||||
1. `App\Dev\SubdomainOptimizationGpt5\Http\Middleware\DomainBootstrap` (NEU, sehr früh)
|
||||
2. `\App\Http\Middleware\EncryptCookies`
|
||||
3. `\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse`
|
||||
4. `\Illuminate\Session\Middleware\StartSession`
|
||||
5. `App\Dev\SubdomainOptimizationGpt5\Http\Middleware\DomainSessionSync` (NEU, nach StartSession)
|
||||
6. `\Illuminate\View\Middleware\ShareErrorsFromSession`
|
||||
7. `\App\Http\Middleware\VerifyCsrfToken`
|
||||
8. ... weitere App-Middleware
|
||||
|
||||
Damit wird garantiert:
|
||||
|
||||
- Vor StartSession: Kein Sessionzugriff (DomainBootstrap ist „rein“)
|
||||
- Nach StartSession: Synchronisierung von `user_shop` in Session + Cookie (DomainSessionSync)
|
||||
|
||||
## Container-Bindings
|
||||
|
||||
- `DomainBootstrap` erzeugt den `DomainContext` selbst (ohne Session) und registriert ihn per `app()->instance(DomainContext::class, $ctx)` sowie zusätzlich als Request-Attribut `domain.context`.
|
||||
- Alte `DomainServiceProvider`-Binding-Strategie kann damit schrittweise entfernt oder angepasst werden (muss nicht sofort).
|
||||
|
||||
## Sticky-Shop-Verhalten
|
||||
|
||||
- Cookie `mvt_shop` (konfigurierbar) trägt den `user_shop`-Slug über Subdomains
|
||||
- Session hält kompakten Zustand: `ctx.user_shop` (id, slug, host)
|
||||
- Optional: Legacy-Keys (`user_shop`, `user_shop_domain`) zur Abwärtskompatibilität aktivierbar
|
||||
|
||||
## Migrationspfad (schrittweise)
|
||||
|
||||
1. NEUE Middleware registrieren (Kernel), alte Logik belassen
|
||||
2. DomainResolver in produktivem Code um Session-Zugriffe entlasten (später)
|
||||
3. Schrittweise Nutzung von `UserShopSessionManager` in Controllern/Views (statt direkter Session-Manipulation)
|
||||
4. Nach Stabilisierung: Legacy-Keys deaktivieren (Konfiguration), Altpfade entfernen
|
||||
|
||||
## Konfiguration
|
||||
|
||||
Siehe `config/example.subdomain_optimization.php`. Wichtig sind Domain-/Cookie-Parameter sowie die Option für Legacy-Keys.
|
||||
|
||||
## Testplan (Auszug)
|
||||
|
||||
- Wechsel `{slug}.mivita.care` → `in.mivita.care` → Zurück-zum-Shop (Slug bleibt erhalten)
|
||||
- Wechsel `{slug}.mivita.care` → `checkout.mivita.care` (Slug bleibt erhalten)
|
||||
- Zugriff `mivita.shop` (Main Shop) setzt Fallback-Shop
|
||||
- Ungültige Subdomain erzeugt KEINE Session (nur Redirect/Fehler, je nach bestehender App-Logik)
|
||||
Loading…
Add table
Add a link
Reference in a new issue