How dunglas/frankenphp works
Main Components
a. Core Components:
• Caddy Web Server Integration (core foundation)
• PHP Runtime Environment
• Worker System
• Early Hints System
• Watcher System
• Metrics System
b. Integration Layers:
• Docker Container Runtime
• Go HTTP Server Interface
• PHP Extension Layer
• Configuration Management
Client Layer
• HTTP/HTTPS Clients
• HTTP/2 and HTTP/3 Support
• WebSocket Connections
Server Layer
• Caddy Server Integration
• TLS/Certificate Management
• Request Router
FrankenPHP Core
• PHP Thread Management
• Worker Mode Handler
• Early Hints System
• Mercure (Real-time) Handler
• Metrics Collector
Runtime Layer
• PHP Runtime (8.4)
• Go Runtime
• CGI Handler
• Environment Manager
Storage & State Layer
• File System Interface
• State Management
• Session Handling
Interaction Flows
• Request/Response Flow
• Worker Communication
• Real-time Events
• Configuration Loading
• Metric Collection Paths
Technical Details to Highlight
• CGI implementation (cgi.go)
• Backoff strategies (backoff.go)
• Metrics collection (metrics.go)
• Thread management (thread-*.go files)
• Worker implementation (worker.go)