-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
The extension's module globals uses a FILE* for the debug log, despite the struct field being named "debug_fd" (we can consider renaming that as part of this ticket).
In phongo_ini.c, we use php_open_temporary_fd to create a temporary file when needed. This returns an opened file descriptor and sets an output variable with the newly created file's path. We end up closing the file descriptor and opening a new stream with the path. Instead, we should consider converting the file descriptor to a stream using fdopen(3) (or _fdopen() on Windows) to be more efficient.
For some added context on why we use FILE* instead of file descriptors: the log handler relies on fprintf(3), which takes a stream argument. Although dprintf(3) does exist for file descriptors, it's not nearly as portable.
- is related to
-
PHPC-2180 Allow applications to register a LogSubscriber globally
- Closed