Documentation
¶
Index ¶
- func AssertBundleSchema(kind string, actual int) error
- func Compose(layout *Layout, extensions []ExtensionComposition) error
- func MergeCompatLayers(defaults, xdebugFragment, extra map[string]string) map[string]string
- func SelectBaseIniFile(layout *Layout, filename string) error
- func SymlinkExtension(soPath, extensionDir, name string) error
- func WriteDisableExtension(confDir, extName string) error
- func WriteIniFragment(confDir, extName string, lines []string) error
- func WriteIniValuesWithDefaults(confDir string, defaults map[string]string, user []plan.IniValue) error
- type ExtensionComposition
- type Layout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertBundleSchema ¶ added in v1.5.0
AssertBundleSchema ensures the bundle's sidecar schema_version meets the runtime's minimum for this kind. A mismatch indicates the bundle was built before a runtime feature that now asserts on its contents (e.g. the php-core share/php/ini/ requirement introduced in the Phase-2 compat closeout, PR #28). Returns a clear error identifying both the kind and the required/actual versions so CI and local diagnostics are unambiguous. Unknown kinds have minimum 0 and always pass.
func Compose ¶
func Compose(layout *Layout, extensions []ExtensionComposition) error
func MergeCompatLayers ¶ added in v1.5.0
MergeCompatLayers returns a single ini-key map composed of (lower-precedence first): defaults → xdebug fragment → extra. Callers pass the result as the `defaults` argument to WriteIniValuesWithDefaults, which then layers user ini-values over the top. Any of the inputs may be nil.
The returned map is always non-nil (may be empty).
func SelectBaseIniFile ¶ added in v1.5.0
SelectBaseIniFile copies the bundle's upstream php.ini-{production,development} template to the effective php.ini location named by layout.IniFile. An empty filename means `ini-file: none` — the target is written empty.
Returns an error if the named source file is not found in layout.IniTemplateDir (which would indicate a builder regression since Task 5 guarantees both files are present in every bundle).
func SymlinkExtension ¶
func WriteDisableExtension ¶ added in v1.2.0
WriteDisableExtension writes a conf.d fragment that documents and enforces non-loading of the named extension. The "00-" filename prefix makes it sort before extension-loading fragments (this codebase writes them as plain "<name>.ini"; see WriteIniFragment).
Because our composed PHP only loads what conf.d explicitly declares, the primary mechanism for disabling is simply the absence of the load directive; this file provides a durable audit trail and defence-in-depth.
func WriteIniFragment ¶
func WriteIniValuesWithDefaults ¶ added in v1.2.0
func WriteIniValuesWithDefaults(confDir string, defaults map[string]string, user []plan.IniValue) error
WriteIniValuesWithDefaults writes compat default ini values first, then user values on top — later writes win because PHP processes the file top-to-bottom. Default keys are written in deterministic (sorted) order. User values are written in their supplied order, matching how shivammathur/setup-php@v2 appends user-specified ini-values on top of the base ini.
If both maps are empty, no file is written and nil is returned.