Documentation
¶
Overview ¶
Package phpsets answers what a PHP version's image actually carries, as opposed to what the user declared. The declared extension/package set applies to every version, but a version cannot always honour it (mongodb needs 8.1+, the 7.4/8.0 images are Alpine 3.16) and an image built before an entry was declared simply predates it. Every surface (CLI, web UI, TUI, MCP) reports from here so none of them can advertise what an image does not have.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Report ¶
type Report struct {
Version string `json:"version"`
// Built is false when lerd has never built an image for this version, in
// which case nothing is claimed about its contents.
Built bool `json:"built"`
// NeedsRebuild means the image was built from an older declared set, so it
// predates entries added since. A rebuild does fix this.
NeedsRebuild bool `json:"needs_rebuild"`
Extensions SetState `json:"extensions"`
Packages SetState `json:"packages"`
// Modules is what `php -m` reports, filled in only by ModulesReport: it
// starts a container, so the cheap per-version status never pays for it.
Modules []string `json:"modules,omitempty"`
}
Report is the state of one PHP version's image.
func ModulesReport ¶
func ModulesReport(cfg *config.GlobalConfig, version string) (Report, error)
ModulesReport is VersionStatus plus the image's own `php -m`, for surfaces that show a version in detail.
func StatusAll ¶
func StatusAll(cfg *config.GlobalConfig, versions []string) []Report
StatusAll reports every version given, in order.
func VersionStatus ¶
func VersionStatus(cfg *config.GlobalConfig, version string) Report
VersionStatus measures the declared sets against one version's image. Cheap: it reads config and two image labels, and never starts a container.
type SetState ¶
type SetState struct {
// Declared is what the user asked for, everywhere.
Declared []string `json:"declared"`
// Has is what this image really carries.
Has []string `json:"has"`
// Cannot is what this image tried to load and could not. A rebuild will
// not change these: they did not build on this version.
Cannot []string `json:"cannot"`
}
SetState is one declared set measured against a single version's image.