The helper function _env() relies on $_ENV validation, preventing the correct use on CLI
To Reproduce
Steps to reproduce the behavior:
Run the application using injected environments variables (like in docker and docker-compose and kubernetes) and skip the use of .env file (using .env files in clusters and containers is bad practice)
debug the content of the container (docker) executing the command printenv to verify the variable you want has been injected in the container.
Dump the content using the PHP function getenv() from inside leaf PHP (cli), The variable injected should be there, cool!
Do the same but with _env()... Hmm, the variable is not there!
Expected behavior
_env() should read the environment variables just like getenv does.
Additional context
I love the simplicity and flexibility of this framework.
What I'm doing is basically running the leaf framework inside a docker container to execute a command (not web), and because is docker, the .env files won't be used to handle environment variables, instead all the variables are injected to the container just like it works with any other framework.
Unfortunately the presence of $_ENV in the validation inside _env function prevent the use of the variable even though the variable was captured by the official PHP function getenv().
Describe the bug
The helper function _env() relies on $_ENV validation, preventing the correct use on CLI
To Reproduce Steps to reproduce the behavior:
printenv
to verify the variable you want has been injected in the container.Expected behavior _env() should read the environment variables just like getenv does.
Additional context I love the simplicity and flexibility of this framework.
What I'm doing is basically running the leaf framework inside a docker container to execute a command (not web), and because is docker, the .env files won't be used to handle environment variables, instead all the variables are injected to the container just like it works with any other framework.
Unfortunately the presence of $_ENV in the validation inside _env function prevent the use of the variable even though the variable was captured by the official PHP function getenv().