Env
Env copied to clipboard
[SUGGESTION] Function to generate a .env file
This would be super useful for things like auto-generated configuration files written in .env (which is what I'm currently attempting to use)
Can you give a bit more info?
I mean a way to get a string of a .env-formatted file from an array (or something similar), for example
use M1\Env\Compiler;
$a = [
'FOO' => 1,
'BAR' => 'whatever'
echo Compiler::compile($a);
Returns:
FOO=1
BAR="whatever"
I could implement something like this, how would multidimensional arrays work though as Bash doesn't support them.
Either provide an option to give a callable to handle arrays within an array or just flat-out don't allow them to happen
Hmmm, I'm feeling like just not letting them happen is a better option.