-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Spark no longer trigger pre_system and post_system events #8442
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
Comments
Sorry, but this is not a bug. https://codeigniter4.github.io/CodeIgniter4/extending/events.html#event-points
|
By the way, what do you want to do with these events when you run spark commands? Probably you can fire these events if you extends |
Use cases: External libraries that extend code igniter use
Since commands have access to the CodeIgniter system, such as cache, config, cookies, email, files, etc. I would argue these events should be fired when commands are running. |
I don't understand why a CLI command has something to do with routing. Spark is not for web applications, but for console applications. |
Routes can be stored in a database for API management purposes. Migrations/Seeds is used to save new routes. Spark is used to run migrations/seeds. I have implemented a workaround that suites my CI4.4 project. And I will have to look for a replacement for |
Perhaps it is possible to add event points for Spark commands. Let's wait and see what others have to say. |
I think adding a couple of spark-specific events would work well. I can't imagine most needs would be the same between CLI and web but this would provide a solution for those that need it. |
How about adding and If anyone is going to implement this, please send a PR to branch |
@Martin-4Spaces Check #8496 |
Awesome @kenjis ! Thank you. |
@Martin-4Spaces The PR is not merged yet. If you believe the PR should be merged, approve it. |
Closed by #8496 |
PHP Version
8.3
CodeIgniter4 Version
4.4.4
CodeIgniter4 Installation Method
Composer (as dependency to an existing project)
Which operating systems have you tested for this bug?
macOS, Linux
Which server did you use?
apache
Database
No response
What happened?
After updating CodeIgniter, some commands broke.
The problems are caused by some code not being executed. Code that fired when events such as pre_system and post_system are triggered.
Steps to Reproduce
Expected Output
I expect spark to fire pre_system and post_system events.
After some research I found this commit, 775fa7d, which moved spark commands outside the CodeIgniter::run method.
Anything else?
I've searched the documentation and changelogs for info about this change. But wittout luck.
Will look for a workaround for now.
The text was updated successfully, but these errors were encountered: