Skip to content

[Dotenv] [DebugCommang] Ensure console commands respect dotenv_path #58159

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

Closed
wants to merge 3 commits into from

Conversation

scruwi
Copy link
Contributor

@scruwi scruwi commented Sep 3, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #58158
License MIT

fix: ensure console commands respect dotenv_path setting from composer.json

  • Updated logic to use the same approach as the dotenv:dump command for determining dotenv_path.

@carsonbot carsonbot added this to the 5.4 milestone Sep 3, 2024
@carsonbot carsonbot changed the title [Dotenv][DebugCommang]: Ensure console commands respect dotenv_path [Dotenv] [DebugCommang]: Ensure console commands respect dotenv_path Sep 3, 2024
@OskarStark OskarStark changed the title [Dotenv] [DebugCommang]: Ensure console commands respect dotenv_path [Dotenv] [DebugCommang] Ensure console commands respect dotenv_path Sep 3, 2024
@xabbuh
Copy link
Member

xabbuh commented Sep 4, 2024

Can we add a test for it?


$output = $this->executeCommand($projectDirectory, 'dev', 'config/.env');

@unlink($projectDirectory.'/composer.json');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? Why don't we store the composer.json file in the fixtures directory in the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it before, but some tests failed for some reason. Please look at the previous commmit.

@nicolas-grekas
Copy link
Member

This concern was solved in #52638
It relies on a new feature so updating to 7.1 is required.
I don't think it's worth fixing in lower branches given this requires hacky solutions (bringing knowledge of composer.json here)

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

Successfully merging this pull request may close these issues.

4 participants