You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calling ini_set('error_log', $logger) seems to expect $logger to be a filesystem path (or a magic identifer like "syslog").
is it possible to pass in a memory stream?
use-case: in phpunit we want to capture all output a possible code beeing tested might write into error_log.
I have implemented this feature with a tmpfile() in sebastianbergmann/phpunit#6118 but IMO it would be cleaner and more efficient (no filesystem IO) if I could pass in a memory stream like php://memory or php://temp:
ini_set() generally works on strings. I don't think this should change.
However it would be probably nice to introduce and accept custom named php://temp/name:foo streams, which are essentially in-request virtual streams which are stored by their name, which are also usable with php internals (like error_log).
Yes.. I was also thinking whether a separate method like set_error_log_handler or similar should be introduced so we don't need to change the ini_set signature
ini_set() generally works on strings. I don't think this should change.
Not sure if this is supported now, but if VFS is already supported, user can (quite easily) register custom scheme handler.
However it would be probably nice to introduce and accept custom named php://temp/name:foo streams, which are essentially in-request virtual streams which are stored by their name, which are also usable with php internals (like error_log).
Description
calling
ini_set('error_log', $logger)
seems to expect $logger to be a filesystem path (or a magic identifer like "syslog").is it possible to pass in a memory stream?
use-case: in phpunit we want to capture all output a possible code beeing tested might write into
error_log
.I have implemented this feature with a
tmpfile()
in sebastianbergmann/phpunit#6118 but IMO it would be cleaner and more efficient (no filesystem IO) if I could pass in a memory stream likephp://memory
orphp://temp
:The text was updated successfully, but these errors were encountered: