Echoing to the console in a CLI script doesn't show in CI4 (Code Igniter 4) until after the script terminates/ends/exits.
I believe this is some security feature but in a CLI run, I'd like to be able to see those echo statements in real-time and not have to exit or stop my code to see what happened.
Is there a configuration for this somewhere or some way to change it easily? I've tried to research this but I must be searching for the wrong terminology, everything I find is irrelevant.
I am using PHP 8.0
Thanks for any help!
I found out that we can use CI4's built-in CLI write function and it will immediately output:
use CodeIgniter\CLI\CLI;
...
CLI::write('See this text immediately');