![]() |
I'm using Laragon with apache 2.4.59-240605 & MySQL 8.3 PHP 8.3 CI 4.5.2
I switched to Laragon because XAMPP is not being updated that much any more. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(06-22-2024, 02:16 AM)kenjis Wrote: This code is invalid. Yeah, that's obviously a typo, but that line was never executed anyway. It should have read: PHP Code: log_message('debug', 'after service(commands)');
So after more debugging, I lucked into finding the problem.
It seems CodeIgniter\CLI\Commands->discoverCommands() was loading vendor\codeigniter4\framework\system\Commands\Server\rewrite.php This caused it to rewrite to localhost anytime command() was called within a controller. Delving into rewrite.php, I see that there is a check to not do the rewrite when in cli. However when running a cli command within a controller on xammp, PHP_SAPI is not 'cli' but 'apache2handler'. So if I crudely fix it as below, it works. I'm not sure what changes has been made since CI 4.4.6 that would result in this new behaviour? Can someone with more knowledge of the framework please check? PHP Code: // Avoid this file run when listing commands
@jetspeed I have confirmed the behavior, and sent a PR to fix it.
Check https://github.com/codeigniter4/CodeIgniter4/pull/8995
@jetspeed thank you!
(06-24-2024, 12:55 AM)kenjis Wrote: @jetspeed I have confirmed the behavior, and sent a PR to fix it.Thank you so much! |
Welcome Guest, Not a member yet? Register Sign In |