[Bug]: herd php:install ignores the version argument and asks which version to install
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 83/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm lệnh php:install và so sánh tham số phiên bản của lệnh này với tham số phpVersion của lệnh php:update, như được mô tả trong issue. Kiểm tra phần trợ giúp của lệnh và tái hiện bằng herd php:install 8.4 để xác nhận tham số bị bỏ qua. Công việc hoàn tất khi lệnh cài đặt phiên bản được yêu cầu mà không hỏi; hãy kiểm tra hành vi tương tác và không tương tác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 124
- Fork
- 1
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của beyondcode/herd-community
-
[Bug]: PHP 8.3 php.ini missing auto_prepend_file and herd-ext extension lines (dump() undefined)Đang mởmacOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
beyondcode/herd-community#1693 ·
-
macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
beyondcode/herd-community#1602 ·
-
[Bug]: herd restart skips PHP versions used only by isolated sites ("Restarting PHP $_sock_...")Đang mởmacOS
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 72/100
beyondcode/herd-community#1770 · 1 bình luận ·
-
windows
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
beyondcode/herd-community#1769 ·
-
macOS needs more information
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
beyondcode/herd-community#1755 · 1 bình luận ·
Tất cả issue của beyondcode/herd-community
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
gavin-wolfe/wolfden#104 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
omarchy-tui-install/remove: bad icon refs install silently, .svg icons are orphaned on removalĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vercel-labs/portless#486 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[rmqctl][Bug] Windows build script fails when the output directory is absentCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/rocketmq-dashboard#7243 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày