refactor: unify php_server logic#2499
Draft
AlliBalliBaba wants to merge 18 commits into
Draft
Conversation
09cd397 to
39db699
Compare
dunglas
reviewed
Jul 2, 2026
| type WorkerOption func(*workerOpt) error | ||
|
|
||
| // PhpServerOption instances allow to configure a PhpServer. | ||
| type PhpServerOption func(*PhpServer) error |
Member
There was a problem hiding this comment.
Suggested change
| type PhpServerOption func(*PhpServer) error | |
| type PHPServerOption func(*PhpServer) error |
(Same for all symbols with "Php")
Actually, couldn't we even drop the "PHP" part entirely as it's in the FrankenPHP module anyway?
| matchRequest func(*http.Request) bool | ||
| maxConsecutiveFailures int | ||
| extensionWorkers *extensionWorkers | ||
| phpServer *PhpServer |
Member
There was a problem hiding this comment.
Suggested change
| phpServer *PhpServer | |
| server *Server |
?
| } | ||
| } | ||
|
|
||
| func WithPhpServerRoot(root string, resolveSymlink bool) PhpServerOption { |
Member
There was a problem hiding this comment.
Couldn't we remove all the functions and only keep "withPHPServer" ?
| // PhpServer represents a php_server block in the caddyfile. | ||
| // can also be used to scope workers to a specific set of configurations. | ||
| type PhpServer struct { | ||
| idx int |
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.
Currently the concept of a
php_serveronly exists on the caddy side and not the FrankenPHP side.Lately we have been moving more and more in a direction of scoping requests or workers to specific
php_serverblocks.This PR is an attempt at refactoring the current
php_serverlogic so it is properly mirrored on the FrankenPHP side without BC breaks for library users (and to prevent future bugs like mentioned in #2487)