php-cooper-symfony

CascEnvResource
in package
implements SelfCheckingResourceInterface

FinalYes

The environment variables a CASC load read while the container was built -- a `${?NAME}` guard, `${NAME}` in an import path or a key, a `${NAME}` Symfony has no placeholder for -- as a container resource: fresh while each still has the value it had.

Only hashes are kept: the resource is serialized next to the cached container, and a variable read at build may well be a secret.

The environment is built again the way the load built it -- the same .env options, the same override layer -- so a change to a .env file counts as much as one to the real environment.

Table of Contents

Interfaces

SelfCheckingResourceInterface

Properties

$dotenvOptions  : array<string|int, mixed>
$hashes  : array<string, string|null>

Methods

__construct()  : mixed
__toString()  : string
isFresh()  : bool
hash()  : string|null

Properties

$dotenvOptions read-only

private array<string|int, mixed> $dotenvOptions

$hashes read-only

private array<string, string|null> $hashes

name => hash of the value, null for unset or empty

Methods

__construct()

public __construct(array<string, string|null> $values, array<string, mixed> $dotenvOptions) : mixed
Parameters
$values : array<string, string|null>

name => the value read, null for unset or empty (a LoadTrace's $env)

$dotenvOptions : array<string, mixed>

the load's .env options: env, dotenv, dotenvEnv, dotenvFiles, dotenvDir, dotenvOverride

__toString()

public __toString() : string
Return values
string —

the variables, by name

isFresh()

public isFresh(int $timestamp) : bool
Parameters
$timestamp : int

unused: an environment has no modification time

Return values
bool —

whether every variable still has the value it had

hash()

private static hash(string|null $value) : string|null
Parameters
$value : string|null
Return values
string|null
On this page

Search results