InteractsWithEnvironment
trait InteractsWithEnvironment
Methods
void
setEnvironmentValue(string $key, string $value)
Set an environment variable for the current PHP process.
void
unsetEnvironmentValue(string $key)
Unset an environment variable for the current PHP process.
mixed
withEnvironmentValue(string $key, string|null $value, Closure $callback)
Run a callback with a temporary environment variable value.
mixed
withEnvironmentValues(array $values, Closure $callback)
Run a callback with temporary environment variable values.
Details
at line 15
protected void
setEnvironmentValue(string $key, string $value)
Set an environment variable for the current PHP process.
at line 27
protected void
unsetEnvironmentValue(string $key)
Unset an environment variable for the current PHP process.
at line 38
protected mixed
withEnvironmentValue(string $key, string|null $value, Closure $callback)
Run a callback with a temporary environment variable value.
at line 48
protected mixed
withEnvironmentValues(array $values, Closure $callback)
Run a callback with temporary environment variable values.