phpsets

package
v1.30.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 7 Imported by: 0

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

func Modules

func Modules(version string) ([]string, error)

Modules returns the extensions a version's image actually loads, read from its own `php -m`. Empty (not an error) for a version with no image: absence of an image is not evidence about its contents.

func NowhereBuilt

func NowhereBuilt(reports []Report, pick func(Report) SetState) []string

NowhereBuilt returns the declared entries that no built, current image carries. A version-specific capability gap shows up on some versions and not others; an entry missing from every one of them points at the build environment instead, which is a different problem with a different answer. Empty when no version has a current image to judge from.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL