Skip to content

Set default config for namespace and author #11243

@Schrank

Description

@Schrank

I just created a composer.json file via composer init and was wondering how I can set default values for the package namespace and the author. I read the documentation, but couldn't find anything about it. Obviously it is read somewhere, where? 😅 I would like to change it.

I see a ton of options here, but is anything of this set via global config? If yes I'm happy to add documentation, if not I'm happy to add a PR for it :-)
https://github.com/composer/composer/blob/main/src/Composer/Command/InitCommand.php#L272-L292

Same for the author:
https://github.com/composer/composer/blob/main/src/Composer/Command/InitCommand.php#L321-L337

So if I'm correct, it should be documented here:

https://getcomposer.org/doc/03-cli.md#environment-variables

and should work like the other env vars, correct? Then I would provide a PR with a couple of lines description and add COMPOSER_DEFAULT_VENDOR and COMPOSER_DEFAULT_AUTHOR .

-> % composer init

  Welcome to the Composer config generator

This command will guide you through creating your composer.json config.

Package name (<vendor>/<name>) [fabian/shopify-tools]: winkelwagen/shopify-tools
Description []:
Author [Fabian Blechschmidt <[email protected]>, n to skip]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions