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

dump-env command doesn't respect real Env Vars during Expansion. #985

Open
sherifabdlnaby opened this issue Jul 13, 2023 · 0 comments
Open

Comments

@sherifabdlnaby
Copy link

Quoting this comment: #507 (comment)

I just ran into this as well. Given this .env file:

FOO=beans
BAR="cool $FOO"

and then in my env exporting another value for FOO:

export FOO=cats

dumping will use the previous value:

$ composer dump-env -- prod
Successfully dumped .env files in .env.local.php

$ cat .env.local.php
<?php

// This file was generated by running "composer dump-env prod"

return array (
  'FOO' => 'beans',
  'BAR' => 'cool beans',
);

this is obviously not what we'd expect.

Our original use case was splitting a DSN connection into strings so we have

TRANSPORT_EVENT_DSN=amqp://${AMQP_USER:-api}:${AMQP_PASS:-api}@${AMQP_HOST:-rabbitmq}:${AMQP_PORT:-5672}/${AMQP_VHOST:-%2f}

after dumping this now has some default value and we can't use it for configuration anymore...

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

1 participant