feat: add non-interactive session checking to modern commands#10134
Open
paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
Open
feat: add non-interactive session checking to modern commands#10134paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
paulbalandan wants to merge 1 commit intocodeigniter4:4.8from
Conversation
23fd7fd to
409db29
Compare
409db29 to
6cfa8ce
Compare
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.
Description
Adds a non-interactive session capability to the modern
AbstractCommandframework introduced in #10120. Previouslyinteract()always fired, so modern commands could hang onCLI::prompt()when run in CI, cron, or piped contexts.This PR adds:
--no-interaction/-N.AbstractCommand:isInteractive(): boolandsetInteractive(bool): static.$this->call(...); a caller-supplied flag wins over propagation.?bool $noInteractionOverrideparameter oncall():null(default) propagates,trueforces non-interactive,falsestrips any inherited--no-interactionso the child resolves its own state.logs:clearnow shows its--forcehint only in non-interactive mode, resolving an existing@todo.Note
The shortcut is
-N(capital) rather than-nbecause several legacy migration commands:migrate,migrate:refresh,migrate:rollbackalready use-nas the shortcut for--namespace. Capital-Nleaves that shortcut free if any of those commands are later migrated toAbstractCommand.Checklist: