Repository navigation
fix(installer): stop CLI input loops on EOF - #2547
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
readline()returnsfalseat EOF,choice()retries indefinitely andask()converts it into an empty answer. Required-field loops can then consume a CPU core. This also happens when every CLI flag is supplied but an existing table prefix triggers another prompt.Branch and changes
Targets
3.6.x, where the reported installer runs. Both prompt methods now throw a contextualRuntimeExceptionon EOF; the existing CLI entrypoint reports it and exits with status 1. Defaults still require an actual empty input line, and piped answers remain supported without a TTY. Prefix collision recovery remains interactive when input is available.Landing surfaces:
install/cli-install.php, a child-process input fixture, and a standalone regression test discovered by the existing test harness. The installer header documents the EOF contract.Verification
9e52db5b: missing mode, missing database, and SQLite prefix collision with all CLI flags supplied. Bounded baseline probes hit their deadlines.cd core && php vendor/bin/pest tests/Unit/Install: 90 passed, 558 assertions.cd core && php vendor/bin/pest tests/Unit/StandaloneScriptsTest.php --filter=CliInstallInputTest: passed through the existing Pest harness (3 assertions; 17 bounded child-process cases).composer analyze: no errors. PHP syntax checks andgit diff --check: passed./dev/null: exit 1 for missing selections/values and for an existing SQLite prefix, with the unanswered question in the error.install/intact and does not write database configuration, even with--removeInstall=y.Scope and remaining items
No changes to database migrations, Composer restoration, or installer cleanup. This fixes the demonstrated EOF loops; it does not establish the cause of a reported process that continued after its script had been deleted. No live site was modified.