10000 [Dotenv][DebugCommang]: Сommand ignores dotenv_path setting in composer.json · Issue #58158 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Dotenv][DebugCommang]: Сommand ignores dotenv_path setting in composer.json #58158
Closed
@scruwi

Description

@scruwi

Symfony version(s) affected

5.4

Description

The console command bin/console debug:dotenv ignores the dotenv_path setting specified in the composer.json file.

How to reproduce

Let's assume that .env* files should be located in the directory <app_root>/config

  1. Set the .env file path in composer.json using dotenv_path:
    "extra": {
        "runtime": {
            "dotenv_path": "config/.env"
        }
    }
  1. Instantiate command:
$projectDirectory = '/var/www/api';
new DebugCommand($_ENV['APP_ENV'], $projectDirectory);
  1. Run the console command bin/console dump:dotenv
  2. Observe that the command does not use the specified path.

Possible Solution

Use the same logic as in the dotenv:dump command to determine the dotenv_path.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0