[Bug]: herd php:install ignores the version argument and asks which version to install
还没有人认领这个 Issue。
评估
调研方向
首先找到 php:install 命令,并按照 issue 中的描述,将它的版本参数与 php:update 命令的 phpVersion 参数进行比较。查看命令帮助,并使用 herd php:install 8.4 重现问题,以确认该参数被忽略。命令无需提示即可安装所请求的版本时,任务即告完成;验证交互式和非交互式行为。
由索引模型根据 Issue 内容生成。
描述
Platform
macOS
Operating system version
macOS 27.0.1 (26A434)
System architecture
ARM64 (M1, M2, etc)
Herd Version
2.0.2 (Build: 71)
PHP Version
Not version-specific (global PHP here: 8.5.10)
Bug description
herd php:install 8.4 ignores the 8.4: instead of installing PHP 8.4 it asks "Which PHP version do you want to install?". That is the usage shown in the docs (herd php:install 8.3), in herd list and in herd php:install --help (php:install [<version>]).
In a terminal you can pick the version from the list. Without one (CI, an AI agent, input from a pipe) the command fails with exit code 1 and tells you to "Pass the value as an argument or option instead", although it was passed (log below).
Expected: herd php:install 8.4 installs PHP 8.4 without asking.
Cause, read in herd.phar 2.0.2: Silly's Application::command() merges $input->getOptions() after $input->getArguments(), so Symfony Console's global --version option (false when not given) overwrites the argument that is also named version. php:install is the only Herd command with an argument of that name; php:update [phpVersion] and isolate [phpVersion] are not affected.
Suggestion: rename the argument to phpVersion, as php:update does.
Workaround: install the version in Settings → PHP, or pick it from the list in a terminal.
Steps to reproduce
- Herd 2.0.2 with a PHP version that is not installed (here 8.4).
- In a terminal, run
herd php:install 8.4: it asks which version to install instead of installing 8.4. Press Ctrl-C (nothing is installed). - Without a terminal:
herd php:install 8.4 < /dev/nullfails with exit code 1.
Relevant log output
$ herd php:install 8.4
┌ Which PHP version do you want to install? ───────────────────┐
│ › ● 8.6 ┃ │
│ ○ 8.4 │ │
│ ○ 8.3 │ │
│ ○ 8.2 │ │
│ ○ 8.1 │ │
└──────────────────────────────────────────────────────────────┘
⚠ Cancelled.
# (Ctrl-C pressed at the question)
$ herd php:install 8.4 < /dev/null; echo "exit=$?"
In app.php line 92:
"herd php:install" asked a question but no terminal is attached to answer i
t. Pass the value as an argument or option instead (see "herd help php:inst
all").
php:install [<version>]
exit=1
- 主要语言
- 没有语言数据
- 星标
- 124
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
beyondcode/herd-community 的其他 Issue
-
macOS
难度 2/5 1-3 小时 新手友好度 76/100
beyondcode/herd-community#1774 ·
-
[Bug]: PHP 8.3 php.ini missing auto_prepend_file and herd-ext extension lines (dump() undefined)未关闭macOS
难度 2/5 1-3 小时 新手友好度 68/100
beyondcode/herd-community#1693 ·
-
macOS
难度 2/5 1-3 小时 新手友好度 72/100
beyondcode/herd-community#1602 ·
-
windows
难度 4/5 3-5 天 新手友好度 35/100
beyondcode/herd-community#1778 ·
-
windows
难度 4/5 3-5 天 新手友好度 45/100
beyondcode/herd-community#1777 ·
查看 beyondcode/herd-community 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
mvanhorn/cli-printing-press#5146 ·
维护者通常 1 天内回复
-
friction
难度 2/5 1-3 小时 新手友好度 70/100
kentcdodds/kody#4142 ·
-
area:cli priority:p2 type:feature
难度 2/5 1-3 小时 新手友好度 76/100
sandtable-ai/sandtable#285 ·
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 83/100
yunaremaia/mcp-guard#121 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
ruvnet/agentic-devops#6 ·