implement PHP_STREAM_FLAG_NO_CLOSE and avoid hacks in plain wrapper

This commit is contained in:
Antony Dovgal 2007-02-21 21:56:45 +00:00
parent 3305731054
commit 30dacafa72
4 changed files with 12 additions and 9 deletions

View file

@ -487,6 +487,12 @@ static void cli_register_file_handles(TSRMLS_D)
s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out);
s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err);
#if PHP_DEBUG
/* do not close stdout and stderr */
s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE;
s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE;
#endif
if (s_in==NULL || s_out==NULL || s_err==NULL) {
FREE_ZVAL(zin);
FREE_ZVAL(zout);