Skip to content

Flex 1.2 / dump-env command and existing environment variables #475

@ipernet

Description

@ipernet

Hi,

$ cat .env|wc -l
101

$ composer dump-env dev && cat .env.local.php 
Successfully dumped .env files in .env.local.php
<?php

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

return array (
  'APP_ENV' => 'dev',
);

In the execution context of the composer dump-env dev command, all my env variables in my .env file are in fact already sourced (already present as env variables).

I would expect the dump-env command to not be impacted by what variables are already set in the env and just dump whatever is in .env* to .env.local.php. Otherwise it leads to unexpected results (empty or partial env cache file generated).

Is that my mistake to have such env variables already sourced or is it an unexpected behavior of dump-env, or both ?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions