Download the PHP package sirix/sirix-env without Composer
On this page you can find all versions of the php package sirix/sirix-env. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sirix/sirix-env
More information about sirix/sirix-env
Files in sirix/sirix-env
Download sirix/sirix-env
More information about sirix/sirix-env
Files in sirix/sirix-env
Vendor sirix
Package sirix-env
Short Description A helper function to retrieve environment variables with type casting
License MIT
Homepage https://github.com/sirix777
Package sirix-env
Short Description A helper function to retrieve environment variables with type casting
License MIT
Homepage https://github.com/sirix777
Please rate this library. Is it a good library?
Informations about the package sirix-env
Sirix Env
A helper function to retrieve environment variables with type casting.
Installation
Install this tool using composer.
composer require sirix/sirix-env
Usage
This library provides a global env function that allows you to retrieve environment variables and automatically cast them to their appropriate PHP types.
Basic Usage
Type Casting
The env function automatically casts string values to the following types:
| Value | PHP Type | Result |
|---|---|---|
'true', '(true)' |
boolean | true |
'false', '(false)' |
boolean | false |
'null', '(null)' |
null | null |
'empty', '(empty)' |
string | '' |
'123', '1.23' |
integer / float | 123 / 1.23 |
| Other values | string | Original string (trimmed) |
Static usage
If you prefer not to use the global function, you can use the EnvParser class directly:
All versions of sirix-env with dependencies
PHP Build Version
Package Version
Requires
php Version
~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
The package sirix/sirix-env contains the following files
Loading the files please wait ...