ContainerLoader
class ContainerLoader
DI container loader.
Methods
No description
Loads the container class, generating it if not already cached. Returns the class name.
Returns the container class name derived from the given key.
No description
Details
at line 19
__construct(string $tempDirectory, bool $autoRebuild = false)
No description
at line 38
string
load(callable $generator, mixed $key = null)
Loads the container class, generating it if not already cached. Returns the class name.
In auto-rebuild mode, when the cached container file has been regenerated since the loaded class was first defined (e.g. user edited a config in a long-running process), a uniquely-named copy of the regenerated class is eval'd into memory and its name is returned instead. This bypasses PHP's inability to redeclare a loaded class and lets long-running processes (workers, dev servers, MCP inspector) pick up config edits live.
at line 48
string
getClassName(mixed $key)
Returns the container class name derived from the given key.
at line 178
protected array
generate(string $class, callable $generator)
No description