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. An empty mode disables xdebug; a non-empty mode is validated via podman.NormaliseXdebugMode and enables xdebug with that canonical value. Apply is idempotent: passing the current mode is a no-op that returns NoChange=true without touching the FPM container.