![]() |
04-22-2025, 09:11 AM
(This post was last modified: 04-22-2025, 10:32 AM by massimiliano1.mancini.)
Thank you for the reply.
(04-22-2025, 07:10 AM)warcooft Wrote: First, you have to define a route in app/Config/Routes.php I'm using Auto Route Improved, and according to the official guide, defining explicit routes like this isn’t necessary in my case: Quote:Define a Route (04-22-2025, 07:10 AM)warcooft Wrote: then run As you noticed, I intentionally used cliMAssage in the second example just to show that the framework is responding correctly. In the actual test, I use cliMessage as expected. I also tried using CLI library commands like CLI::print, but haven't had success with that either. EDIT: I've conducted further investigation and found that the cliMessage method in the Cronjob controller is not being called at all. I ran a debug session and set a breakpoint on the output line within the cliMessage method, and I confirmed that this point is never reached. For this reason, I'm updating the topic title, as the missing output is merely a consequence of a prior issue: the method doesn't appear to be invoked correctly in the first place. EDIT2: Solved! The problem was that I forgot to update the Config/Filters.php file in order to exclude the cli/cronjob/message path from mandatory authentication Code: 'auth' => ['except' => [ After this fix the method is corrected invoked. I leave this post as it could be useful for other users. Thank you |
Messages In This Thread |
Problem with CLI script routing or execution - by massimiliano1.mancini - 04-22-2025, 05:34 AM
RE: Problem with CLI script output - by warcooft - 04-22-2025, 07:10 AM
Problem with CLI script routing or execution - by massimiliano1.mancini - 04-22-2025, 09:11 AM
RE: Problem with CLI script routing or execution - by gosocial2 - 04-23-2025, 06:51 AM
|