Skip to content

DockerComposeConfigurator do not honors composer.json configuration #1060

@jawira

Description

@jawira

Description

DockerComposeConfigurator do not honors composer.json configuration. For example, the following configuration will create docker compose files:

{
...
  "extra": {
    "symfony": {
      "docker": "false"
    }
  }
}

However follwing configurations will work as expected, they will not create nor update docker compose files:

{
...
  "extra": {
    "symfony": {
      "docker": false
    }
  }
}
{
...
  "extra": {
    "symfony": {
      "docker": "0"
    }
  }
}

How to reproduce

  1. Configure your project with the following Composer command composer config extra.symfony.docker false.
  2. Install a pack that updates docker compose files, for example composer require orm.
  3. Docker compose files will be created/updated even if this is not desired.

Problem

So clearly the catch is that a string "false" is set with the composer config extra.symfony.docker false command, and this string is not recognized by PHP as a proper boolean (unlike "0" string in my examples). However because composer config command can only set strings! There is no way to set a proper boolean.

IMHO, Flex should be capable to recognize "false" string as a boolean since composer config is an a configuration command provided by Composer itself.

I identified this bug because I run composer config extra.symfony.docker false programatically in every project I create.

Fix

I created an MR that fixes this issue: #1061

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