php

package
v1.12.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClampToRange added in v1.10.0

func ClampToRange(version, min, max string) string

ClampToRange checks if version falls within [min, max] and returns the best installed version within range if it doesn't. Returns the original version if min/max are empty or the version is already in range. This is used to respect framework PHP version constraints during site linking.

func DetectExtensions added in v0.5.5

func DetectExtensions(dir string) []string

DetectExtensions reads composer.json in dir and returns the list of PHP extensions declared in the require map (ext-* keys), with the "ext-" prefix stripped. Returns an empty slice on any error (non-fatal).

func DetectVersion

func DetectVersion(dir string) (string, error)

DetectVersion detects the PHP version for the given directory. It checks, in order:

  1. .lerd.yaml php_version field (explicit lerd override)
  2. .php-version file (explicit per-project pin)
  3. composer.json require.php semver (project requirement)
  4. global config default

func DetectVersionClamped added in v1.11.0

func DetectVersionClamped(dir, phpMin, phpMax, fallback string) string

DetectVersionClamped detects the PHP version and clamps it to the given range. If phpMin/phpMax are empty, no clamping is applied.

func IsInstalled

func IsInstalled(version string) bool

IsInstalled returns true if the given PHP version has an FPM quadlet.

func ListInstalled

func ListInstalled() ([]string, error)

ListInstalled returns all PHP versions that have an FPM quadlet file or a running/existing Podman container, e.g. ["8.3", "8.4"]. The two sources are merged so users whose quadlet file is missing but whose container still exists are not excluded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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