-if (function_exists('posix_isatty')) {
- define('CONSOLE_INTERACTIVE', posix_isatty(0));
-} else {
- // Windows? Assume we're on a terminal. :P
- define('CONSOLE_INTERACTIVE', false);
-}
-if (CONSOLE_INTERACTIVE) {
- define('CONSOLE_READLINE', function_exists('readline'));
-}
+// Assume we're on a terminal if on Windows, otherwise posix_isatty tells us.
+define('CONSOLE_INTERACTIVE', !function_exists('posix_isatty') || posix_isatty(0));
+define('CONSOLE_READLINE', CONSOLE_INTERACTIVE && function_exists('readline'));