feat: mercure_publish() PHP function to dispatch Mercure updates#1927
Merged
feat: mercure_publish() PHP function to dispatch Mercure updates#1927
Conversation
2133bf5 to
42916be
Compare
henderkes
reviewed
Nov 1, 2025
eb44602 to
860e51a
Compare
ba424f9 to
7160d84
Compare
7160d84 to
3f41e51
Compare
henderkes
reviewed
Nov 17, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a mercure_publish() PHP function to dispatch Mercure updates using the built-in Mercure hub, providing a convenient native function alternative to HTTP-based publishing.
- Implements Go-to-PHP bridging for Mercure hub integration
- Adds Caddy integration to auto-discover and inject Mercure hub
- Includes build tag support (
nomercure) for optional compilation
Reviewed Changes
Copilot reviewed 21 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mercure.go | Main Go implementation of go_mercure_publish with Mercure hub integration |
| mercure-skip.go | Stub implementation when built with nomercure tag |
| context.go | Adds mercureContext to frankenPHPContext for hub storage |
| frankenphp.c | C implementation of mercure_publish() PHP function |
| frankenphp.stub.php | PHP function signature declaration for mercure_publish() |
| frankenphp_arginfo.h | Generated argument info for the new function |
| caddy/mercure.go | Caddy integration to discover and inject Mercure hub |
| caddy/mercure-skip.go | Caddy stub when built without Mercure |
| caddy/module.go | Updates to conditionally inject Mercure hub into requests |
| caddy/workerconfig.go | Improved error handling in worker configuration parsing |
| caddy/app.go | Simplified error handling for subdirective errors |
| caddy/caddy.go | Fixed typo and improved error message formatting |
| frankenphp.go | Removed unused ErrRequestContextCreation variable |
| docs/mercure.md | Added documentation for mercure_publish() function |
| docs/compile.md | Documented Mercure as optional dependency with build tag |
| go.mod, go.sum | Added github.com/dunglas/mercure v0.21.2 dependency |
| caddy/go.mod, caddy/go.sum | Updated Mercure caddy module to v0.21.2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Nov 24, 2025
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.
Add a PHP function to publish updates using the built-in Mercure hub.
Needs dunglas/mercure#1098