Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to call commands programatically. #3238

Merged
merged 2 commits into from
Jul 7, 2020
Merged

Conversation

lonnieezell
Copy link
Member

  • Refactored CommandRunner to bring all logic out to its own class.
  • added new command common helper function to allow calling other commands programatically.
  • Updated CLI class to be able to handle being ran when NOT on the cli. Will echo out the content instead.

@lonnieezell lonnieezell requested a review from MGatner July 7, 2020 04:56
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I don't really have any projects right now where this would be applicable, but I'm tackling cron with Tasks soon and this will likely be a boon. I tested my most CLI-intensive module against it and all tests passed.

@lonnieezell
Copy link
Member Author

@MGatner thanks for the review! Will definitely come in handy for cron stuff, I believe, which is part of why I built it. Also - was trying to write tests for a cache:clear command, and realized what a giant pain it was since the command runner was a controller. :)

@lonnieezell
Copy link
Member Author

Oh - and don't forget the already started codeigniter4-tasks if you're going to be working on Tasks. :)

@lonnieezell lonnieezell merged commit bcd8955 into develop Jul 7, 2020
@MGatner
Copy link
Member

MGatner commented Jul 7, 2020

Oh believe me I haven’t forgotten! I’m just holding off as long as I can before unleashing on it 😊

@paulbalandan paulbalandan deleted the commandrefactor branch October 24, 2020 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants