Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGESTION] Function to generate a .env file #4

Open
jjvvx opened this issue Jan 15, 2017 · 5 comments
Open

[SUGGESTION] Function to generate a .env file #4

jjvvx opened this issue Jan 15, 2017 · 5 comments

Comments

@jjvvx
Copy link

jjvvx commented Jan 15, 2017

This would be super useful for things like auto-generated configuration files written in .env (which is what I'm currently attempting to use)

@m1
Copy link
Owner

m1 commented Jan 15, 2017

Can you give a bit more info?

@jjvvx
Copy link
Author

jjvvx commented Jan 16, 2017

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"

@m1
Copy link
Owner

m1 commented Jan 17, 2017

I could implement something like this, how would multidimensional arrays work though as Bash doesn't support them.

@jjvvx
Copy link
Author

jjvvx commented Jan 18, 2017

Either provide an option to give a callable to handle arrays within an array or just flat-out don't allow them to happen

@m1
Copy link
Owner

m1 commented Jan 18, 2017

Hmmm, I'm feeling like just not letting them happen is a better option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants