Load configured includes in execute() - #954
Merged
bobthecow merged 2 commits intoAug 26, 2026
Merged
Conversation
Keep include loading out of the public API while allowing Shell subclasses to use it before direct execution. Add coverage that loads an include through a subclass and reads its variable from executed code.
Owner
|
thanks! i’m not sure is there a reason we'd want to execute without honoring configured includes? what if we keep it private and have |
Load configured includes when a top-level execute call owns shell execution, while sharing one depth counter with run so internal execute calls do not load them again. Keep the include loader private, preserve the existing run ordering, and reset nesting in finally. Cover nested execute calls, commands run inside a shell session, and run re-entry.
Contributor
Author
|
@bobthecow Done. Could you please check it out when you have a moment and let me know what you think? |
Owner
|
Looks great, thank you! |
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.
Laravel and Hypervel Tinker set include files on the shell before calling
execute(), but PsySH only loads them whenrun()is used. Switching torun()isn’t equivalent because it treats input as PsySH commands and prints return values.This makes
execute()load configured includes itself. They’re loaded once for the outer call, so calls made while PsySH is already running don’t load them again.