Skip to content

"--" in console command line leaves kernel.environment unset #27916

Closed
@seschwar

Description

@seschwar

Symfony version(s) affected: 3.* & 4.*

Description
If -- is used in the command line of the bin/console script the Kernel's environment doesn't get set.

How to reproduce

$ composer create-project --no-interaction symfony/framework-standard-edition 3.4 '3.4.*'
(...)
$ 3.4/bin/console --

In FileLocator.php line 44:
                                                              
  The file "/tmp/3.4/app/config/config_.yml" does not exist.                                                                


I could expect bin/console -- to work exactly the same as bin/console and execute the list sub-command.

Symfony 4 doesn't produce a fatal error, however the Kernel's environment still isn't set correctly:

$ composer create-project --no-interaction symfony/skeleton 4.1 '4.1.*'
(...)
$ 4.1/bin/console --
Symfony 4.1.1 (kernel: src, env: , debug: true)

Usage:
(...)

Note the empty env:.

This leads to silent bugs with for example several of the Kernel's directories pointing to wrong locations.

Possible Solution

It looks like ArgvInput::getParameterOption() is called in bin/console with a default value, which however is seemingly ignored.

Pull request incoming...

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