Skip to content
docsv0.1.0

MilpaCore

Static facts and runtime checks about this package's one hard dependency, `milpa/core` — the version constraint milpa/live was built against, which `milpa/core` contracts it relies on, and whether the currently-installed `milpa/core` actually satisfies them. Useful for a host application's own diagnostics/health-check page, not consulted by milpa/live itself at runtime.

MilpaCore::package()

public static function package(): string

The Composer package name milpa/live depends on: `"milpa/core"`.

MilpaCore::versionConstraint()

public static function versionConstraint(): string

The Composer version constraint milpa/live requires `milpa/core` at.

MilpaCore::release()

public static function release(): string

The `milpa/core` release tag milpa/live was built and verified against.

MilpaCore::minimumPhp()

public static function minimumPhp(): string

The minimum PHP version `milpa/core` (and therefore milpa/live) requires.

MilpaCore::namespacePrefix()

public static function namespacePrefix(): string

The namespace prefix `milpa/core`'s own symbols live under: `"Milpa\\"`.

MilpaCore::contractMap()

public static function contractMap(): array

Maps a short, stable key (e.g. `'pluginInterface'`) to the fully qualified `milpa/core` class/interface name it currently resolves to — a single place to update if a `milpa/core` symbol is ever renamed.

MilpaCore::availableContracts()

public static function availableContracts(): array

Checks every {@see contractMap()} entry against the classes/interfaces actually autoloadable right now, so a caller can tell "milpa/core is * installed" apart from "the specific symbols we depend on exist".

MilpaCore::isRuntimeCompatible()

public static function isRuntimeCompatible(?string $phpVersion = null): bool

True when `$phpVersion` (defaults to the running `PHP_VERSION`) meets {@see minimumPhp()}.

Parameters

Parameters of isRuntimeCompatible()
NameTypeDescription
$phpVersion?string

MilpaCore::isInstalled()

public static function isInstalled(): bool

True when `milpa/core` is present — via `Composer\InstalledVersions` when available, falling back to checking for its `composer.json` in `vendor/` (e.g. under a `path` repository during local development).

MilpaCore::installedVersion()

public static function installedVersion(): ?string

The installed `milpa/core` version (via `Composer\InstalledVersions`, falling back to its `composer.json`'s `version` field), or `null` when neither source can resolve one.

MilpaCore::status()

public static function status(): array

A single snapshot combining every static fact and runtime check on this class — the shape a diagnostics/health-check endpoint would serialize directly.

MilpaCore::installCommand()

public static function installCommand(): string

The `composer require` snippet that installs `milpa/core` at {@see versionConstraint()}.