LoadTrace
in package
What `Cooper::loadFileTraced()` returns: the loaded config, together with everything that load depended on.
It exists for a caller that keeps a loaded config somewhere Cache
cannot see -- a compiled PHP file, a shared store -- and so must
decide for itself when that copy has gone stale. The answer is the
same one Cache gives itself: the copy holds while every file in
$files keeps its modification time, no import in $globs has
changed() -- a file added where import "parts/*.casc" looks is in
no list of files read -- and every name in $env still has the value
recorded there.
$env holds every environment variable the document read in any way:
an ordinary ${NAME} value, a ${?NAME} guard, ${NAME} in an
import path or an interpolated key. A name read while unset or empty
is recorded as null -- unset and empty read the same (CASC.md ยง7.2).
The values are as resolution saw them, after .env layering and the
COOPER_ENV fallback (see Dotenv), and may well be secrets: treat
this object as carefully as the config itself.
A scheme:// import has no file to fingerprint, and a !{...}
resolver's answer has no name to compare; neither appears here.
Table of Contents
Properties
- $config : array<string|int, mixed>
- $env : array<string|int, mixed>
- $files : array<string|int, mixed>
- $globs : array<string|int, mixed>
Methods
- __construct() : mixed
Properties
$config read-only
public
array<string|int, mixed>
$config
$env read-only
public
array<string|int, mixed>
$env
$files read-only
public
array<string|int, mixed>
$files
$globs read-only
public
array<string|int, mixed>
$globs
= []
Methods
__construct()
public
__construct(array<string|int, mixed> $config, array<int, string> $files, array<string, string|null> $env[, array<int, ImportGlob> $globs = [] ]) : mixed
Parameters
- $config : array<string|int, mixed>
-
the loaded config, exactly as
Cooper::loadFile()returns it - $files : array<int, string>
-
every real file the load read: the entry file and everything it imported, as absolute paths
- $env : array<string, string|null>
-
every environment variable the document read => the value it saw,
nullfor unset or empty - $globs : array<int, ImportGlob> = []
-
every filesystem import's expansion: its root, its pattern, and the files it matched