Reconcile-based server manager for dynamic PHP version switching#52
Merged
munezaclovis merged 9 commits intomainfrom Mar 27, 2026
Merged
Reconcile-based server manager for dynamic PHP version switching#52munezaclovis merged 9 commits intomainfrom
munezaclovis merged 9 commits intomainfrom
Conversation
ServerManager owns all FrankenPHP instances and provides a single Reconcile() method that reads configs from disk, diffs running instances against what's needed, and starts/stops accordingly. Handles crashed instance detection and restart.
Replace inline secondary management with manager.Reconcile(). Add SIGHUP handler to event loop for CLI-triggered reconcile. Simplify waitForEvent. Remove ReconfigureServer(). Callers in cmd/ updated in next commit.
- pv link: 15 lines of restart logic → SignalDaemon() - pv unlink: 23 lines of orphan detection → SignalDaemon() - pv restart: SIGHUP in foreground, full restart in daemon mode - pv php:use: always full daemon restart (main binary changes)
Service add/remove/destroy generate service site configs but never told FrankenPHP to reload. Now send SIGHUP so the daemon reconciles and the main FrankenPHP picks up new service routes.
- Reconcile() now returns accumulated errors when secondary instances fail to start (previously returned nil hiding partial failures) - SIGHUP handler wraps Reconcile() in recover() so a panic doesn't crash the entire daemon event loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a reconcile architecture so the daemon can dynamically start/stop secondary FrankenPHP instances when PHP versions change without requiring daemon restarts.
New: ServerManager + SIGHUP protocol
Simplified CLI commands
Test plan