Documentation
¶
Overview ¶
Package xdebugops contains the shared business logic for toggling Xdebug on a PHP version: mode validation, config persistence, ini write, FPM quadlet update, and unit restart. The CLI, UI, and MCP all call into here so the three surfaces stay in lockstep on state transitions and ordering.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
Version string
Mode string // canonical mode after Apply; "" means xdebug disabled
Enabled bool // convenience: Mode != ""
NoChange bool // true when the requested state already matched; no restart was attempted
Restarted bool // true when the FPM unit restart succeeded
// RestartErr is set when the FPM unit restart failed. Non-fatal: config and
// ini are already persisted, the caller just needs to surface a hint so
// the user can restart the unit manually.
RestartErr error
}
Result describes the outcome of Apply so callers can render their own user-facing message without inspecting the config again.
func Apply ¶
Apply toggles Xdebug for version with the default start_with_request=yes (connect on every request). See ApplyWithStart for on-demand modes.
func ApplyWithStart ¶ added in v1.25.0
ApplyWithStart toggles Xdebug for version and sets its start_with_request value (yes | trigger | no). An empty mode disables xdebug; a non-empty mode is validated via podman.NormaliseXdebugMode. With "trigger"/"no", debugging is driven on demand (a trigger cookie, or the control socket via `lerd xdebug pause`) instead of every request and worker connecting. It is idempotent: passing the current mode and start returns NoChange=true.