[Bug]: herd php:install ignores the version argument and asks which version to install
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
Direzione di ricerca
Inizia individuando il comando php:install e confrontando il suo argomento della versione con l’argomento phpVersion del comando php:update, come descritto nell’issue. Controlla la guida del comando e riproduci il problema con herd php:install 8.4 per confermare che l’argomento viene ignorato. Il lavoro è terminato quando il comando installa la versione richiesta senza chiedere conferma; verifica il comportamento interattivo e non interattivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 124
- Fork
- 1
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di beyondcode/herd-community
-
[Bug]: PHP 8.3 php.ini missing auto_prepend_file and herd-ext extension lines (dump() undefined)ApertamacOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
beyondcode/herd-community#1693 ·
-
macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
beyondcode/herd-community#1602 ·
-
[Bug]: herd restart skips PHP versions used only by isolated sites ("Restarting PHP $_sock_...")ApertamacOS
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
beyondcode/herd-community#1770 · 1 commento ·
-
windows
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
beyondcode/herd-community#1769 ·
-
macOS needs more information
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
beyondcode/herd-community#1755 · 1 commento ·
Tutte le issue di beyondcode/herd-community
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
gavin-wolfe/wolfden#104 ·
I maintainer di solito rispondono entro 1 giorno
-
omarchy-tui-install/remove: bad icon refs install silently, .svg icons are orphaned on removalAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vercel-labs/portless#486 ·
I maintainer di solito rispondono entro 3 giorni
-
[rmqctl][Bug] Windows build script fails when the output directory is absentForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/rocketmq-dashboard#7243 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno