在哪里设置Composer环境变量

时间:2021-11-05 23:02:15

I don't want to disable Xdebug, I don't care that it's slower, so I see there is an environment variable COMPOSER_DISABLE_XDEBUG_WARN and the docs mention setting it in the config.

我不想禁用Xdebug,我不在乎它的速度慢,所以我看到有一个环境变量COMPOSER_DISABLE_XDEBUG_WARN,并且文档提到在配置中设置它。

So, I opened my global /Users/username/.composer/config.json and add:

所以,我打开了我的全局/Users/username/.composer/config.json并添加:

{
    "config": {
        "COMPOSER_DISABLE_XDEBUG_WARN": true
    }
}

No change.

不用找了。

Where or how do I set this environment variable to get rid of this damn message?

在哪里或如何设置此环境变量以摆脱这个该死的消息?

3 个解决方案

#1


2  

The PHP CLI inherits the environment variables from your shell. You can add the following line to your .bash_profile (or whatever you use for your shell).

PHP CLI从shell继承环境变量。您可以将以下行添加到.bash_profile(或您用于shell的任何内容)。

export COMPOSER_DISABLE_XDEBUG_WARN=1

export COMPOSER_DISABLE_XDEBUG_WARN = 1

Make sure to close the terminal, and reopen it to load the new variable.

确保关闭终端,然后重新打开它以加载新变量。

Source: https://*.com/a/18098263/58795

资料来源:https://*.com/a/18098263/58795

#2


0  

Use COMPOSER_DISABLE_XDEBUG_WARN as ENVVAR https://github.com/composer/composer/issues/4622#issuecomment-158678115

使用COMPOSER_DISABLE_XDEBUG_WARN作为ENVVAR https://github.com/composer/composer/issues/4622#issuecomment-158678115

#3


-1  

As per Composer documentation for this flag, ...

根据此标志的Composer文档,...

"COMPOSER_DISABLE_XDEBUG_WARN": 1

set it to 1, not true to disable the warning. (Ya, I know, if I was coding this part of Composer I would've accepted any truthy value but what can you do, ask for your money back?)

将其设置为1,而不是禁用警告。 (呀,我知道,如果我编写这部分作曲家,我会接受任何真正的价值,但你能做些什么,请你退钱?)

#1


2  

The PHP CLI inherits the environment variables from your shell. You can add the following line to your .bash_profile (or whatever you use for your shell).

PHP CLI从shell继承环境变量。您可以将以下行添加到.bash_profile(或您用于shell的任何内容)。

export COMPOSER_DISABLE_XDEBUG_WARN=1

export COMPOSER_DISABLE_XDEBUG_WARN = 1

Make sure to close the terminal, and reopen it to load the new variable.

确保关闭终端,然后重新打开它以加载新变量。

Source: https://*.com/a/18098263/58795

资料来源:https://*.com/a/18098263/58795

#2


0  

Use COMPOSER_DISABLE_XDEBUG_WARN as ENVVAR https://github.com/composer/composer/issues/4622#issuecomment-158678115

使用COMPOSER_DISABLE_XDEBUG_WARN作为ENVVAR https://github.com/composer/composer/issues/4622#issuecomment-158678115

#3


-1  

As per Composer documentation for this flag, ...

根据此标志的Composer文档,...

"COMPOSER_DISABLE_XDEBUG_WARN": 1

set it to 1, not true to disable the warning. (Ya, I know, if I was coding this part of Composer I would've accepted any truthy value but what can you do, ask for your money back?)

将其设置为1,而不是禁用警告。 (呀,我知道,如果我编写这部分作曲家,我会接受任何真正的价值,但你能做些什么,请你退钱?)