phpini

package
v1.30.0-beta.2 Latest Latest
Warning

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

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

Documentation

Overview

Package phpini centralizes the php.ini editor's scope handling so the CLI, the web UI, and the MCP server share one definition of what a scope is, which file it maps to, and which containers a change restarts. A scope is one of:

"shared"        the version-agnostic file applied to every PHP version
"<version>"     an installed PHP version's own file (e.g. "8.4")
"site:<name>"   a FrankenPHP site's own per-site file

The shared file mounts below the per-version file in every container's conf.d, so a per-version (or per-site) key always overrides a shared one.

Index

Constants

View Source
const SharedScope = "shared"

SharedScope is the editor scope for the version-agnostic shared php.ini.

View Source
const SharedTemplate = `` /* 344-byte string literal not displayed */

SharedTemplate seeds the editor for the shared file. Applies to every version, with a per-version file winning on any conflicting key.

View Source
const UserTemplate = `` /* 277-byte string literal not displayed */

UserTemplate seeds the editor when a per-version or per-site file does not exist yet. Matches the stub the podman EnsureUserIni writes so the editor shows the same guidance.

Variables

This section is empty.

Functions

func Ensure

func Ensure(scope string) error

Ensure seeds the on-disk file backing a scope so the bind-mount source stays a regular file (podman would otherwise auto-create a directory at the conf.d path). Safe to call repeatedly; it never overwrites an existing file.

func Restart

func Restart(scope string) error

Restart applies a scope's ini change by restarting the containers that mount it. For the shared file that is every installed version's FPM plus its per-site containers; for a version, that one FPM plus its per-site containers; for a site, just that FrankenPHP container.

func RestartNoSeed

func RestartNoSeed(scope string) error

RestartNoSeed restarts a scope's container(s) after a reset. The per-version file is not re-seeded (the shared FPM tolerates its absence: only that one version's container mounts it, and the reset means "no per-version override"). The shared file IS re-seeded first, because every PHP container mounts it and a missing bind-mount source makes them all fail to start; re-seeding the commented template is functionally "no shared override" while keeping the mount valid. A FrankenPHP site is re-seeded for the same bind-mount reason.

func ScopeFile

func ScopeFile(scope string) cfgedit.File

ScopeFile returns the cfgedit.File a scope reads and writes: the shared file, a FrankenPHP site's own file, or the per-version file.

func Valid

func Valid(scope string) bool

Valid reports whether a scope is a valid php.ini editor scope: the shared file, an installed PHP version, or "site:<name>" for a FrankenPHP site.

Types

This section is empty.

Jump to

Keyboard shortcuts

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