![]() |
isCLI method broken - I think it is a bug.. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: isCLI method broken - I think it is a bug.. (/showthread.php?tid=82393) |
isCLI method broken - I think it is a bug.. - yahyaerturan - 07-06-2022 Hi all, In my app, I have extended IncomingRequest class and change overwrite request service to return my new extended class. PHP Code: <?php Inside in getActiveLanguages() method; PHP Code: if ($this->isCLI()) { What can I do? Is there a change here? Or it is a bug? I have checked the Github.. In 4.2.0 some changes made IncomingRequest and CLIRequest files. After in 4.2.1 those changes are reverted back. Upgrading to 4.2.1 is the solution. Thanks.. RE: isCLI method broken - I think it is a bug.. - iRedds - 07-06-2022 1. For CLI, use Spark commands. 2. Why do you need a language in the CLI? It doesn't make any practical sense. RE: isCLI method broken - I think it is a bug.. - jobyjosephme - 03-06-2023 why ci4 is overcomplicating things. why cant it be like ci3 and allow developers to use it like they wish. i felt ci4 is forcing developers to use only one way where ci3 allow much more freedom. RE: isCLI method broken - I think it is a bug.. - kenjis - 03-06-2023 (03-06-2023, 07:50 AM)jobyjosephme Wrote: why ci4 is overcomplicating things. why cant it be like ci3 and allow developers to use it like they wish. i felt ci4 is forcing developers to use only one way where ci3 allow much more freedom. The reason is complex. 1. CI4 tries to simplify things. CI4 provides Spark commands for CLI. Controllers are for Web, Spark commands are for CLI. 1. CI4 recommends better practices. Using Controllers via CLI is not good practice. 2. CI4's CLIRequest is a bit broken or having design flaw in my opinion. So if you believe a behavior is a bug, please report it on GitHub. |