mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
* feat: mercure_publish() PHP function to dispatch Mercure updates * fix stubs for old versions * review * cleanup and fixes
21 lines
439 B
Go
21 lines
439 B
Go
//go:build !nomercure
|
|
|
|
package caddy
|
|
|
|
import (
|
|
"github.com/caddyserver/caddy/v2"
|
|
"github.com/dunglas/frankenphp"
|
|
mercureCaddy "github.com/dunglas/mercure/caddy"
|
|
)
|
|
|
|
func init() {
|
|
mercureCaddy.AllowNoPublish = true
|
|
}
|
|
|
|
func (f *FrankenPHPModule) assignMercureHubRequestOption(ctx caddy.Context) {
|
|
if hub := mercureCaddy.FindHub(ctx.Modules()); hub != nil {
|
|
opt := frankenphp.WithMercureHub(hub)
|
|
f.mercureHubRequestOption = &opt
|
|
}
|
|
}
|