Add HTTP proxy configuration example
维护者通常 1 天内回复
@swissspidy 已经在做这个了。
开始于 2026年2月3日。
评估
这个 Issue 还没有评估数据。
描述
Split out from https://github.com/wp-cli/core-command/issues/292
- php-curl happens to honor the http_proxy env var
- Requests defers honoring that env var to the library user (e.g., WordPress core or WP-CLI) (see also https://github.com/WordPress/Requests/issues/218)
- WP-CLI doesn't want to blindly trust that env var
- One should be able to manually configure proxy support via
wp-cli.ymland theextra-phpconfig
You might be able to do something like this:
# In wp-cli.yml
require:
- path-to/proxy.php
// proxy.php
$proxy_host = getenv( 'HTTP_PROXY' );
if ( ! $proxy_host ) {
return;
}
$proxy_url = parse_url( $proxy_host );
if ( $proxy_url['host'] ) {
define( 'WP_PROXY_HOST', $proxy_url['host'] );
}
if ( $proxy_url['port'] ) {
define( 'WP_PROXY_PORT', $proxy_url['port'] );
}
This would configure the proxy for HTTP requests in core when using WP-CLI, similar to when you define this in wp-config.php. The setup would be slightly more complex for modifying HTTP requests from WP-CLI itself.
- 主要语言
- PHP
- 星标
- 205
- 派生
- 377
- 平均合并
- 3 天 1 小时
- 30 天内合并 PR
- 10
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Automattic/blocks-engine#4621 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
YunoHost-Apps/snappymail_ynh#205 ·
-
难度 2/5 1-3 小时 新手友好度 77/100
Automattic/static-site-importer#2653 ·
维护者通常 1 天内回复
-
Bug (unconfirmed) Search :mag:
难度 2/5 1-3 小时 新手友好度 66/100
FreshRSS/FreshRSS#9533 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
ExpressionEngine/ExpressionEngine#5453 ·
维护者通常 1 天内回复