Skip to content

Guard CLI progress TTY detection when POSIX ext is unavailable#86

Open
pbritka wants to merge 1 commit into
WeareJH:masterfrom
pbritka:feature/guard-posix-isatty
Open

Guard CLI progress TTY detection when POSIX ext is unavailable#86
pbritka wants to merge 1 commit into
WeareJH:masterfrom
pbritka:feature/guard-posix-isatty

Conversation

@pbritka

@pbritka pbritka commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Progress\Factory::get() calls posix_isatty(STDOUT) directly. On PHP builds without the posix extension (some production CLI environments), this is an undefined function and fatals with Call to undefined function whenever the app is not in developer mode — breaking import crons.

The TTY check is wrapped in function_exists('posix_isatty') via a small isInteractiveCliOutput() helper. Without posix it falls back to NullProgress, the correct behaviour for a non-TTY/cron context. No change where posix is present.

Progress\Factory::get() calls posix_isatty(STDOUT) directly. On PHP builds
without the posix extension (e.g. some production CLI environments), this is an
undefined function and fatals with "Call to undefined function" when not in
developer mode. Wrap the check in function_exists() so it falls back to
NullProgress, which is the correct behaviour for a non-TTY context.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant