I tried looking at while loops and do while loops with different implementations of STDIN, but in all cases the loop would not continue until the user entered something.
For example, this does not work:
Code: Select all
do {
gfunc::dply_msg('Checking backend for an updated config...');
// Logic to check for an updated config and to act on it if nessissary
sleep(1);
$quit = fgets(STDIN);
} while ( trim($quit) != 'quit');Here is what I want the script flow to be: check for an updated config file, sleep 1 seconds, check if the user entered quit, if not, continue
Anyone have any insight into my problem? Thanks!