Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Runtime] project_dir option in composer.json always overwritten in autoload_runtime.php #59954

Open
@wickedOne

Description

@wickedOne

Symfony version(s) affected

6.4

Description

the runtime documentation suggests one can override the project_dir in the composer.json, however the generated autoload file will contain an option array with a duplicate key overriding that option when doing so.

How to reproduce

execute the following commands and inspect the vendor/autoload_runtime.php file:

composer config extra.runtime.project_dir '/foo/bar/' && composer dump-autoload

Possible Solution

offending line
https://github.com/symfony/runtime/blob/8e8d09bd69b7f6c0260dd3d58f37bd4fbdeab5ad/Internal/ComposerPlugin.php#L99

could be changed to:
'%runtime_options%' => '['. substr(var_export(array_merge(['project_dir' => $projectDir], $extra), true), 7, -1)."]",

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