Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 892 Bytes

File metadata and controls

27 lines (17 loc) · 892 Bytes

Global Functions

The following global functions are available with the Environment package.

Using these functions will require the Titon\Environment\Detector class to be registered in a Titon\Context\Depository instance.

env(string $key): string

Returns a variable value defined by key. Learn more about environment variables.

$key = env('API_KEY');

is_env(string $key): bool

Verify which environment is detected by matching against the APP_ENV variable. Learn more about environment detection.

is_env('local'); // true

detector_context(): Titon\Environment\Detector

Returns the Titon\Environment\Detector instance found in the Titon\Context\Depository container. If no instance exists, it will attempt to make one.