Documentation

Registry
in package

Central resolver for everything the framework loads by convention.

Precedence everywhere: userspace -> modules (ordered) -> framework.

find() results are memoized per request so one name maps to exactly one file for the whole request, including error-page reroutes.

Table of Contents

files()  : array<string|int, string>
find()  : string|null
Locates one file of $kind in two passes over the ordered roots.
moduleRoots()  : array<string|int, string>
paths()  : array<string|int, string>
labeledPaths()  : array<string|int, mixed>

Methods

files()

public static files(string $kind) : array<string|int, string>
Parameters
$kind : string
Return values
array<string|int, string>

Every file of $kind across all roots, in precedence order.

find()

Locates one file of $kind in two passes over the ordered roots.

public static find(string $kind, string $name) : string|null

Pass 1 flat-probes every root in precedence order; it is byte identical to the historical lookup, so every name that resolved before this abstraction resolves to the same file at the same cost. Pass 2 runs only when every root missed flat, and only for bare names: the lazy recursive index per root, shallowest match first. Nested files are therefore only reachable for names that previously resolved nowhere; they can never shadow a flat file in a later root.

Parameters
$kind : string
$name : string
Return values
string|null

moduleRoots()

public static moduleRoots(string $kind) : array<string|int, string>
Parameters
$kind : string
Return values
array<string|int, string>

Module roots only, for call sites that keep a historical non-standard order (assets) or treat modules as a distinct set (migrations).

paths()

public static paths(string $kind) : array<string|int, string>
Parameters
$kind : string
Return values
array<string|int, string>

Ordered roots where $kind can live.

labeledPaths()

private static labeledPaths(Kind $definition) : array<string|int, mixed>
Parameters
$definition : Kind
Return values
array<string|int, mixed>

Search results