From a0e0d8d013f8d878624aef27aa5e8d5d5b7e54f2 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 29 Aug 2016 11:57:53 +0200 Subject: [PATCH 01/40] Add VT100 support for Windows The first parameter should be a stream (php://stdout or php://stderr). If no second parameter is specified: the function checks if the stream supports VT100 control codes: - Windows: returns TRUE if Windows is 10.0.10586 or greater, the console has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag and the stream is not redirected. - POSIX: returns TRUE if the stream is not redirected. - Others cases: returns FALSE If the second parameter is specified: the function tries to enable or disable the VT100 control codes. - Windows: returns TRUE if Windows is 10.0.10586 or greater, the stream is not redirected and the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag has been set/unset - POSIX: returns TRUE is enabling and the stream is not redirected - POSIX: returns TRUE is disabling and the stream is redirected - Others cases: returns FALSE --- ext/standard/basic_functions.c | 6 ++ ext/standard/streamsfuncs.c | 124 +++++++++++++++++++++++++++++++++ ext/standard/streamsfuncs.h | 1 + win32/build/config.w32 | 2 +- win32/console.c | 121 ++++++++++++++++++++++++++++++++ win32/console.h | 52 ++++++++++++++ 6 files changed, 305 insertions(+), 1 deletion(-) create mode 100644 win32/console.c create mode 100644 win32/console.h diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 58f9b491511f1..0564301979e69 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2011,6 +2011,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_vt100_support, 0, 0, 1) + ZEND_ARG_INFO(0, stream) + ZEND_ARG_INFO(0, enable) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4) ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */ ZEND_ARG_INFO(1, write_streams) /* ARRAY_INFO(1, write_streams, 1) */ @@ -3134,6 +3139,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream) PHP_FE(stream_get_contents, arginfo_stream_get_contents) PHP_FE(stream_supports_lock, arginfo_stream_supports_lock) + PHP_FE(stream_vt100_support, arginfo_stream_vt100_support) PHP_FE(fgetcsv, arginfo_fgetcsv) PHP_FE(fputcsv, arginfo_fputcsv) PHP_FE(flock, arginfo_flock) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 3ab362f62854c..4d429789cefda 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -37,6 +37,7 @@ typedef unsigned long long php_timeout_ull; #else #include "win32/select.h" #include "win32/sockets.h" +#include "win32/console.h" typedef unsigned __int64 php_timeout_ull; #endif @@ -1635,6 +1636,129 @@ PHP_FUNCTION(stream_supports_lock) RETURN_TRUE; } +/* {{{ proto proto stream_vt100_support(string stream[, bool enable]) + Get or set VT100 support for the specified stream. +*/ +PHP_FUNCTION(stream_vt100_support) +{ + zend_string *stream; + zend_bool enable; +#ifdef PHP_WIN32 + DWORD handle_id; +#else + int fileno; +#endif + int argc = ZEND_NUM_ARGS(); + + if (zend_parse_parameters(argc, "S|b", &stream, &enable) == FAILURE) { + return; + } + if (!stream || !ZSTR_VAL(stream) || !ZSTR_LEN(stream)) { + /* Empty stream name */ + RETURN_FALSE; + } + +#ifdef PHP_WIN32 + /* Determine the Windows standard handle associated to the stream name received */ + if (strcmp(ZSTR_VAL(stream), "php://stdin") == 0) { + handle_id = STD_INPUT_HANDLE; + } + else if (strcmp(ZSTR_VAL(stream), "php://stdout") == 0) { + handle_id = STD_OUTPUT_HANDLE; + } + else if (strcmp(ZSTR_VAL(stream), "php://stderr") == 0) { + handle_id = STD_ERROR_HANDLE; + } + else { + RETURN_FALSE; + } +#else + /* Determine the file descriptor identifier associated to the stream name received */ + if (strcmp(ZSTR_VAL(stream), "php://stdin") == 0) { + fileno = STDIN_FILENO; + } + else if (strcmp(ZSTR_VAL(stream), "php://stdout") == 0) { + fileno = STDOUT_FILENO; + } + else if (strcmp(ZSTR_VAL(stream), "php://stderr") == 0) { + fileno = STDERR_FILENO; + } else { + RETURN_FALSE; + } +#endif + + if (argc == 1) { + /* Check if the specified stream supports VT100 control codes */ +#ifdef PHP_WIN32 + /* Check if the current Windows version supports VT100 control codes */ + if (!_php_win32_console_os_supports_vt100()) { + RETURN_FALSE; + } + /* Check if the Windows standard handle is redirected to file */ + if (_php_win32_console_handle_is_redirected(handle_id)) { + RETURN_FALSE; + } + /* Check if the Windows standard handle has VT100 control codes enabled */ + if (_php_win32_console_handle_has_vt100(handle_id)) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } +#elif HAVE_POSIX + /* Check if the file descriptor identifier is a terminal */ + if (isatty(fileno)) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } +#else + RETURN_FALSE; +#endif + } + else { + /* Enable/disable VT100 control codes support for the specified stream */ +#ifdef PHP_WIN32 + /* Check if the current Windows version supports VT100 control codes */ + if (!_php_win32_console_os_supports_vt100()) { + RETURN_FALSE; + } + /* Check if the Windows standard handle is redirected to file */ + if (_php_win32_console_handle_is_redirected(handle_id)) { + RETURN_FALSE; + } + /* Enable/disable VT100 control codes support for the specified Windows standard handle */ + if (_php_win32_console_handle_set_vt100(handle_id, enable ? TRUE : FALSE)) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } +#elif HAVE_POSIX + /* Check if the file descriptor identifier is a terminal */ + if (isatty(fd)) { + if (enable) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } + } + else { + if (enable) { + RETURN_FALSE; + } + else { + RETURN_TRUE; + } + } +#else + RETURN_FALSE; +#endif + } +} + #ifdef HAVE_SHUTDOWN /* {{{ proto int stream_socket_shutdown(resource stream, int how) causes all or part of a full-duplex connection on the socket associated diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 45f51c29549b8..ab169a3439337 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -61,6 +61,7 @@ PHP_FUNCTION(stream_socket_shutdown); PHP_FUNCTION(stream_resolve_include_path); PHP_FUNCTION(stream_is_local); PHP_FUNCTION(stream_supports_lock); +PHP_FUNCTION(stream_vt100_support); #if HAVE_SOCKETPAIR PHP_FUNCTION(stream_socket_pair); diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 5d974b711081e..74350332b96dd 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -165,7 +165,7 @@ ADD_FLAG("CFLAGS_BD_MAIN_STREAMS", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES("win32", "dllmain.c glob.c readdir.c \ registry.c select.c sendmail.c time.c winutil.c wsyslog.c globals.c \ - getrusage.c ftok.c ioutil.c codepage.c"); + getrusage.c ftok.c ioutil.c codepage.c console.c"); ADD_FLAG("CFLAGS_BD_WIN32", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); diff --git a/win32/console.c b/win32/console.c new file mode 100644 index 0000000000000..df6ac9528f97f --- /dev/null +++ b/win32/console.c @@ -0,0 +1,121 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2016 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michele Locati | + +----------------------------------------------------------------------+ + */ + +/* $Id$ */ + +#include "win32/console.h" + +BOOL _php_win32_console_os_supports_vt100() +{ + const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586; + static BOOL result = 2; + + if (result == 2) { + result = FALSE; + HMODULE module_handle = GetModuleHandle(TEXT("ntdll.dll")); + + if (module_handle) { + _php_win32_console_rtlgetversion rtlgetversion_pointer = (_php_win32_console_rtlgetversion)GetProcAddress(module_handle, "RtlGetVersion"); + + if (rtlgetversion_pointer != NULL) { + RTL_OSVERSIONINFOW rtl_versioninfo = { 0 }; + + rtl_versioninfo.dwOSVersionInfoSize = sizeof(rtl_versioninfo); + if (rtlgetversion_pointer(&rtl_versioninfo) == 0) { + if ( + rtl_versioninfo.dwMajorVersion > MINV_MAJOR + || + ( + rtl_versioninfo.dwMajorVersion == MINV_MAJOR + && + ( + rtl_versioninfo.dwMinorVersion > MINV_MINOR + || + ( + rtl_versioninfo.dwMinorVersion == MINV_MINOR + && rtl_versioninfo.dwBuildNumber >= MINV_BUILD + ) + ) + ) + ) { + result = TRUE; + } + } + } + } + } + return result; +} + +BOOL _php_win32_console_handle_is_redirected(DWORD handle_id) +{ + BOOL result = FALSE; + HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; + + if (handle != INVALID_HANDLE_VALUE) { + if (GetFinalPathNameByHandle(handle, NULL, 0, 0) != 0 || GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + result = TRUE; + } + } + return result; +} + +BOOL _php_win32_console_handle_has_vt100(DWORD handle_id) +{ + BOOL result = FALSE; + HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; + + if (handle != INVALID_HANDLE_VALUE) { + DWORD mode; + + if (GetConsoleMode(handle, &mode)) { + if (mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) { + result = TRUE; + } + } + } + return result; +} + +BOOL _php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) +{ + BOOL result = FALSE; + HANDLE handle = handle_id ? GetStdHandle(STD_OUTPUT_HANDLE) : INVALID_HANDLE_VALUE; + + if (handle != INVALID_HANDLE_VALUE) { + DWORD mode; + + if (GetConsoleMode(handle, &mode)) { + if (((mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) ? 1 : 0) == (enable ? 1 : 0)) { + result = TRUE; + } + else { + if (enable) { + mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } + else { + mode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } + if (SetConsoleMode(handle, mode)) { + result = TRUE; + } + } + } + } + return result; +} diff --git a/win32/console.h b/win32/console.h new file mode 100644 index 0000000000000..ce02624b59bb1 --- /dev/null +++ b/win32/console.h @@ -0,0 +1,52 @@ +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2016 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Michele Locati | + +----------------------------------------------------------------------+ +*/ + +/* $Id$ */ + +#ifndef PHP_WIN32_CONSOLE_H +#define PHP_WIN32_CONSOLE_H + +#include "php.h" +#include "php_streams.h" +#include + +#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING +#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 +#endif + +/* Pointer type to the RtlGetVersion function of ntdll.dll */ +typedef LONG (WINAPI * _php_win32_console_rtlgetversion) (PRTL_OSVERSIONINFOW); + +/* Check if the current Windows version supports VT100 control codes */ +BOOL _php_win32_console_os_supports_vt100(); + +/* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) + is redirected to a file */ +BOOL _php_win32_console_handle_is_redirected(DWORD handle_id); + +/* Check if the console attached to the specified standard handle + (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the + ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */ +BOOL _php_win32_console_handle_has_vt100(DWORD handle_id); + +/* Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console + attached to the specified standard handle (STD_OUTPUT_HANDLE, + STD_ERROR_HANDLE) */ +BOOL _php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); + +#endif From 18c5c427eee5ec8c68ebe2f33cdc5a951732b737 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 08:34:49 +0200 Subject: [PATCH 02/40] Fix function names prefix --- ext/standard/streamsfuncs.c | 12 ++++++------ win32/console.c | 10 +++++----- win32/console.h | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 4d429789cefda..b064a5239a451 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1691,15 +1691,15 @@ PHP_FUNCTION(stream_vt100_support) /* Check if the specified stream supports VT100 control codes */ #ifdef PHP_WIN32 /* Check if the current Windows version supports VT100 control codes */ - if (!_php_win32_console_os_supports_vt100()) { + if (!php_win32_console_os_supports_vt100()) { RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (_php_win32_console_handle_is_redirected(handle_id)) { + if (php_win32_console_handle_is_redirected(handle_id)) { RETURN_FALSE; } /* Check if the Windows standard handle has VT100 control codes enabled */ - if (_php_win32_console_handle_has_vt100(handle_id)) { + if (php_win32_console_handle_has_vt100(handle_id)) { RETURN_TRUE; } else { @@ -1721,15 +1721,15 @@ PHP_FUNCTION(stream_vt100_support) /* Enable/disable VT100 control codes support for the specified stream */ #ifdef PHP_WIN32 /* Check if the current Windows version supports VT100 control codes */ - if (!_php_win32_console_os_supports_vt100()) { + if (!php_win32_console_os_supports_vt100()) { RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (_php_win32_console_handle_is_redirected(handle_id)) { + if (php_win32_console_handle_is_redirected(handle_id)) { RETURN_FALSE; } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ - if (_php_win32_console_handle_set_vt100(handle_id, enable ? TRUE : FALSE)) { + if (php_win32_console_handle_set_vt100(handle_id, enable ? TRUE : FALSE)) { RETURN_TRUE; } else { diff --git a/win32/console.c b/win32/console.c index df6ac9528f97f..f468d97b55629 100644 --- a/win32/console.c +++ b/win32/console.c @@ -20,7 +20,7 @@ #include "win32/console.h" -BOOL _php_win32_console_os_supports_vt100() +BOOL php_win32_console_os_supports_vt100() { const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586; static BOOL result = 2; @@ -30,7 +30,7 @@ BOOL _php_win32_console_os_supports_vt100() HMODULE module_handle = GetModuleHandle(TEXT("ntdll.dll")); if (module_handle) { - _php_win32_console_rtlgetversion rtlgetversion_pointer = (_php_win32_console_rtlgetversion)GetProcAddress(module_handle, "RtlGetVersion"); + php_win32_console_rtlgetversion rtlgetversion_pointer = (php_win32_console_rtlgetversion)GetProcAddress(module_handle, "RtlGetVersion"); if (rtlgetversion_pointer != NULL) { RTL_OSVERSIONINFOW rtl_versioninfo = { 0 }; @@ -62,7 +62,7 @@ BOOL _php_win32_console_os_supports_vt100() return result; } -BOOL _php_win32_console_handle_is_redirected(DWORD handle_id) +BOOL php_win32_console_handle_is_redirected(DWORD handle_id) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; @@ -75,7 +75,7 @@ BOOL _php_win32_console_handle_is_redirected(DWORD handle_id) return result; } -BOOL _php_win32_console_handle_has_vt100(DWORD handle_id) +BOOL php_win32_console_handle_has_vt100(DWORD handle_id) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; @@ -92,7 +92,7 @@ BOOL _php_win32_console_handle_has_vt100(DWORD handle_id) return result; } -BOOL _php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) +BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(STD_OUTPUT_HANDLE) : INVALID_HANDLE_VALUE; diff --git a/win32/console.h b/win32/console.h index ce02624b59bb1..cb5f709e3d12b 100644 --- a/win32/console.h +++ b/win32/console.h @@ -30,23 +30,23 @@ #endif /* Pointer type to the RtlGetVersion function of ntdll.dll */ -typedef LONG (WINAPI * _php_win32_console_rtlgetversion) (PRTL_OSVERSIONINFOW); +typedef LONG (WINAPI * php_win32_console_rtlgetversion) (PRTL_OSVERSIONINFOW); /* Check if the current Windows version supports VT100 control codes */ -BOOL _php_win32_console_os_supports_vt100(); +BOOL php_win32_console_os_supports_vt100(); /* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) is redirected to a file */ -BOOL _php_win32_console_handle_is_redirected(DWORD handle_id); +BOOL php_win32_console_handle_is_redirected(DWORD handle_id); /* Check if the console attached to the specified standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */ -BOOL _php_win32_console_handle_has_vt100(DWORD handle_id); +BOOL php_win32_console_handle_has_vt100(DWORD handle_id); /* Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console attached to the specified standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) */ -BOOL _php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); +BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); #endif From be500625feb945ebffc8c7b1672ad5f64c4bb80e Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 08:40:12 +0200 Subject: [PATCH 03/40] Use Unicode version of GetFinalPathNameByHandle --- win32/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/console.c b/win32/console.c index f468d97b55629..091888f9c6cc3 100644 --- a/win32/console.c +++ b/win32/console.c @@ -68,7 +68,7 @@ BOOL php_win32_console_handle_is_redirected(DWORD handle_id) HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; if (handle != INVALID_HANDLE_VALUE) { - if (GetFinalPathNameByHandle(handle, NULL, 0, 0) != 0 || GetLastError() == ERROR_INSUFFICIENT_BUFFER) { + if (GetFinalPathNameByHandleW(handle, NULL, 0, 0) != 0 || GetLastError() == ERROR_INSUFFICIENT_BUFFER) { result = TRUE; } } From e11f3d20e8e6ad91f4a1663af09a9db9de6575ae Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 09:02:51 +0200 Subject: [PATCH 04/40] Use EG(windows_version_info) instead of RtlGetVersion --- win32/console.c | 63 +++++++++++++++++++++---------------------------- win32/console.h | 3 --- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/win32/console.c b/win32/console.c index 091888f9c6cc3..e32cef67e4b1e 100644 --- a/win32/console.c +++ b/win32/console.c @@ -23,43 +23,34 @@ BOOL php_win32_console_os_supports_vt100() { const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586; - static BOOL result = 2; - - if (result == 2) { - result = FALSE; - HMODULE module_handle = GetModuleHandle(TEXT("ntdll.dll")); - - if (module_handle) { - php_win32_console_rtlgetversion rtlgetversion_pointer = (php_win32_console_rtlgetversion)GetProcAddress(module_handle, "RtlGetVersion"); - - if (rtlgetversion_pointer != NULL) { - RTL_OSVERSIONINFOW rtl_versioninfo = { 0 }; - - rtl_versioninfo.dwOSVersionInfoSize = sizeof(rtl_versioninfo); - if (rtlgetversion_pointer(&rtl_versioninfo) == 0) { - if ( - rtl_versioninfo.dwMajorVersion > MINV_MAJOR - || - ( - rtl_versioninfo.dwMajorVersion == MINV_MAJOR - && - ( - rtl_versioninfo.dwMinorVersion > MINV_MINOR - || - ( - rtl_versioninfo.dwMinorVersion == MINV_MINOR - && rtl_versioninfo.dwBuildNumber >= MINV_BUILD - ) - ) - ) - ) { - result = TRUE; - } - } - } - } + OSVERSIONINFOEX osvi = EG(windows_version_info); + // Check operating system platform + if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) { + return FALSE; } - return result; + // Check major version number + if (osvi.dwMajorVersion > MINV_MAJOR) { + return TRUE; + } + if (osvi.dwMajorVersion < MINV_MAJOR) { + return FALSE; + } + // Check minor version number + if (osvi.dwMinorVersion > MINV_MINOR) { + return TRUE; + } + if (osvi.dwMinorVersion < MINV_MINOR) { + return FALSE; + } + // Check build number + if (osvi.dwBuildNumber > MINV_BUILD) { + return TRUE; + } + if (osvi.dwBuildNumber < MINV_BUILD) { + return FALSE; + } + return TRUE; + } BOOL php_win32_console_handle_is_redirected(DWORD handle_id) diff --git a/win32/console.h b/win32/console.h index cb5f709e3d12b..f2ab2c37ad515 100644 --- a/win32/console.h +++ b/win32/console.h @@ -29,9 +29,6 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif -/* Pointer type to the RtlGetVersion function of ntdll.dll */ -typedef LONG (WINAPI * php_win32_console_rtlgetversion) (PRTL_OSVERSIONINFOW); - /* Check if the current Windows version supports VT100 control codes */ BOOL php_win32_console_os_supports_vt100(); From 6953d2f7c5f8056af183b7c6667a0090270d8087 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 10:39:05 +0200 Subject: [PATCH 05/40] Use the specified handle_id instead of STD_OUTPUT_HANDLE --- win32/console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32/console.c b/win32/console.c index e32cef67e4b1e..582e21ffcaeda 100644 --- a/win32/console.c +++ b/win32/console.c @@ -86,7 +86,7 @@ BOOL php_win32_console_handle_has_vt100(DWORD handle_id) BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) { BOOL result = FALSE; - HANDLE handle = handle_id ? GetStdHandle(STD_OUTPUT_HANDLE) : INVALID_HANDLE_VALUE; + HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; if (handle != INVALID_HANDLE_VALUE) { DWORD mode; From bd93781159e977a4d5a8d5620838fffc061192a1 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 12:37:28 +0200 Subject: [PATCH 06/40] Switch from stream name to stream resource --- ext/standard/streamsfuncs.c | 62 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index b064a5239a451..cdeb0dfbd414d 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1636,56 +1636,54 @@ PHP_FUNCTION(stream_supports_lock) RETURN_TRUE; } -/* {{{ proto proto stream_vt100_support(string stream[, bool enable]) +/* {{{ proto proto stream_vt100_support(resource stream[, bool enable]) Get or set VT100 support for the specified stream. */ PHP_FUNCTION(stream_vt100_support) { - zend_string *stream; + zval *z_stream; + php_stream *stream; + int fileno; zend_bool enable; #ifdef PHP_WIN32 DWORD handle_id; -#else - int fileno; #endif int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "S|b", &stream, &enable) == FAILURE) { + if (zend_parse_parameters(argc, "z|b", &z_stream, &enable) == FAILURE) { return; } - if (!stream || !ZSTR_VAL(stream) || !ZSTR_LEN(stream)) { - /* Empty stream name */ - RETURN_FALSE; - } - -#ifdef PHP_WIN32 - /* Determine the Windows standard handle associated to the stream name received */ - if (strcmp(ZSTR_VAL(stream), "php://stdin") == 0) { - handle_id = STD_INPUT_HANDLE; - } - else if (strcmp(ZSTR_VAL(stream), "php://stdout") == 0) { - handle_id = STD_OUTPUT_HANDLE; + stream = NULL; + switch (Z_TYPE_P(z_stream)) { + case IS_RESOURCE: + php_stream_from_zval_no_verify(stream, z_stream); + break; } - else if (strcmp(ZSTR_VAL(stream), "php://stderr") == 0) { - handle_id = STD_ERROR_HANDLE; - } - else { + if (stream == NULL) { RETURN_FALSE; } -#else - /* Determine the file descriptor identifier associated to the stream name received */ - if (strcmp(ZSTR_VAL(stream), "php://stdin") == 0) { - fileno = STDIN_FILENO; - } - else if (strcmp(ZSTR_VAL(stream), "php://stdout") == 0) { - fileno = STDOUT_FILENO; - } - else if (strcmp(ZSTR_VAL(stream), "php://stderr") == 0) { - fileno = STDERR_FILENO; + if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); + } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); } else { RETURN_FALSE; } + switch (fileno) { + case STDOUT_FILENO: +#ifdef PHP_WIN32 + handle_id = STD_OUTPUT_HANDLE; +#endif + break; + case STDERR_FILENO: +#ifdef PHP_WIN32 + handle_id = STD_ERROR_HANDLE; #endif + break; + default: + RETURN_FALSE; + } + if (argc == 1) { /* Check if the specified stream supports VT100 control codes */ @@ -1737,7 +1735,7 @@ PHP_FUNCTION(stream_vt100_support) } #elif HAVE_POSIX /* Check if the file descriptor identifier is a terminal */ - if (isatty(fd)) { + if (isatty(fileno)) { if (enable) { RETURN_TRUE; } From 35bf19a9dbd857bc3d64139907383feda01bd69e Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 14:50:36 +0200 Subject: [PATCH 07/40] Allow running tests capturing only stdout and/or stderr --- run-tests.php | 50 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/run-tests.php b/run-tests.php index 80757edd9085b..d1ad779d3cfa6 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1062,7 +1062,7 @@ function error_report($testname, $logname, $tested) } } -function system_with_timeout($commandline, $env = null, $stdin = null) +function system_with_timeout($commandline, $env = null, $stdin = null, $captureStdOut = true, $captureStdErr = true) { global $leak_check, $cwd; @@ -1073,11 +1073,16 @@ function system_with_timeout($commandline, $env = null, $stdin = null) $bin_env[$key] = $value; } - $proc = proc_open($commandline, array( + $descriptorspec = array( 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ), $pipes, $cwd, $bin_env, array('suppress_errors' => true, 'binary_pipes' => true)); + ); + if ($captureStdOut) { + $descriptorspec[1] = array('pipe', 'w'); + } + if ($captureStdErr) { + $descriptorspec[2] = array('pipe', 'w'); + } + $proc = proc_open($commandline, $descriptorspec, $pipes, $cwd, $bin_env, array('suppress_errors' => true, 'binary_pipes' => true)); if (!$proc) { return false; @@ -1107,7 +1112,13 @@ function system_with_timeout($commandline, $env = null, $stdin = null) proc_terminate($proc, 9); return $data; } else if ($n > 0) { - $line = fread($pipes[1], 8192); + if ($captureStdOut) { + $line = fread($pipes[1], 8192); + } elseif ($captureStdErr) { + $line = fread($pipes[2], 8192); + } else { + $line = ''; + } if (strlen($line) == 0) { /* EOF */ break; @@ -1338,6 +1349,19 @@ function run_test($php, $file, $env) return 'BORKED'; } + if (isset($section_text['CAPTURE_STDIO'])) { + $captureStdOut = stripos($section_text['CAPTURE_STDIO'], 'STDOUT') !== false; + $captureStdErr = stripos($section_text['CAPTURE_STDIO'], 'STDERR') !== false; + } else { + $captureStdOut = true; + $captureStdErr = true; + } + if ($captureStdOut && $captureStdErr) { + $cmdRedirect = ' 2>&1'; + } else { + $cmdRedirect = ''; + } + $tested = trim($section_text['TEST']); /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */ @@ -1750,7 +1774,7 @@ function run_test($php, $file, $env) } save_text($tmp_post, $request); - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; } elseif (array_key_exists('PUT', $section_text) && !empty($section_text['PUT'])) { @@ -1784,7 +1808,7 @@ function run_test($php, $file, $env) } save_text($tmp_post, $request); - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; } else if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) { @@ -1801,7 +1825,7 @@ function run_test($php, $file, $env) $env['CONTENT_LENGTH'] = $content_length; } - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; } else if (array_key_exists('GZIP_POST', $section_text) && !empty($section_text['GZIP_POST'])) { @@ -1816,7 +1840,7 @@ function run_test($php, $file, $env) $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; $env['CONTENT_LENGTH'] = $content_length; - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; } else if (array_key_exists('DEFLATE_POST', $section_text) && !empty($section_text['DEFLATE_POST'])) { $post = trim($section_text['DEFLATE_POST']); @@ -1829,7 +1853,7 @@ function run_test($php, $file, $env) $env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; $env['CONTENT_LENGTH'] = $content_length; - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\""; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\"$cmdRedirect < \"$tmp_post\""; } else { @@ -1837,7 +1861,7 @@ function run_test($php, $file, $env) $env['CONTENT_TYPE'] = ''; $env['CONTENT_LENGTH'] = ''; - $cmd = "$php $pass_options $ini_settings -f \"$test_file\" $args 2>&1"; + $cmd = "$php $pass_options $ini_settings -f \"$test_file\" $args$cmdRedirect"; } if ($leak_check) { @@ -1873,7 +1897,7 @@ function run_test($php, $file, $env) junit_start_timer($shortname); - $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null); + $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null, $captureStdOut, $captureStdErr); junit_finish_timer($shortname); From d9b1c99a0233f218bf0137e9fad2e0923b06836a Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 30 Aug 2016 15:08:57 +0200 Subject: [PATCH 08/40] Add tests for stream_vt100_support function --- ...vt100_support_posix_redirected_stderr.phpt | 21 +++++++++++++ ...vt100_support_posix_redirected_stdout.phpt | 18 +++++++++++ ...t100_support_win_supported_redirected.phpt | 25 ++++++++++++++++ .../vt100_support_win_supported_stderr.phpt | 27 +++++++++++++++++ .../vt100_support_win_supported_stdout.phpt | 30 +++++++++++++++++++ .../output/vt100_support_win_unsupported.phpt | 25 ++++++++++++++++ 6 files changed, 146 insertions(+) create mode 100644 tests/output/vt100_support_posix_redirected_stderr.phpt create mode 100644 tests/output/vt100_support_posix_redirected_stdout.phpt create mode 100644 tests/output/vt100_support_win_supported_redirected.phpt create mode 100644 tests/output/vt100_support_win_supported_stderr.phpt create mode 100644 tests/output/vt100_support_win_supported_stdout.phpt create mode 100644 tests/output/vt100_support_win_unsupported.phpt diff --git a/tests/output/vt100_support_posix_redirected_stderr.phpt b/tests/output/vt100_support_posix_redirected_stderr.phpt new file mode 100644 index 0000000000000..9bba5489e31fe --- /dev/null +++ b/tests/output/vt100_support_posix_redirected_stderr.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDERR +--SKIPIF-- + +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECT-- +bool(true) +bool(false) diff --git a/tests/output/vt100_support_posix_redirected_stdout.phpt b/tests/output/vt100_support_posix_redirected_stdout.phpt new file mode 100644 index 0000000000000..feef083a264f6 --- /dev/null +++ b/tests/output/vt100_support_posix_redirected_stdout.phpt @@ -0,0 +1,18 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDOUT +--SKIPIF-- + +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECT-- +bool(false) +bool(true) diff --git a/tests/output/vt100_support_win_supported_redirected.phpt b/tests/output/vt100_support_win_supported_redirected.phpt new file mode 100644 index 0000000000000..8a8a60f363b92 --- /dev/null +++ b/tests/output/vt100_support_win_supported_redirected.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDIO/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT, STDERR +--FILE-- + +--EXPECT-- +bool(false) +bool(false) diff --git a/tests/output/vt100_support_win_supported_stderr.phpt b/tests/output/vt100_support_win_supported_stderr.phpt new file mode 100644 index 0000000000000..44e6b4a5b2663 --- /dev/null +++ b/tests/output/vt100_support_win_supported_stderr.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test stream_vt100_support for STDERR on newer Windows versions +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(false) diff --git a/tests/output/vt100_support_win_supported_stdout.phpt b/tests/output/vt100_support_win_supported_stdout.phpt new file mode 100644 index 0000000000000..09d1e64d67566 --- /dev/null +++ b/tests/output/vt100_support_win_supported_stdout.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test stream_vt100_support for STDOUT on newer Windows versions +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(false) diff --git a/tests/output/vt100_support_win_unsupported.phpt b/tests/output/vt100_support_win_unsupported.phpt new file mode 100644 index 0000000000000..62294430d6b9e --- /dev/null +++ b/tests/output/vt100_support_win_unsupported.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test stream_vt100_support for older Windows versions +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECT-- +bool(false) +bool(false) +bool(false) From 2f0564358253e750391a133ed9d748e40074ffaa Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 4 Oct 2016 13:24:45 +0200 Subject: [PATCH 09/40] Export Win32 console functions --- win32/console.c | 8 ++++---- win32/console.h | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/win32/console.c b/win32/console.c index 582e21ffcaeda..e616e45538bb4 100644 --- a/win32/console.c +++ b/win32/console.c @@ -20,7 +20,7 @@ #include "win32/console.h" -BOOL php_win32_console_os_supports_vt100() +PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100() { const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586; OSVERSIONINFOEX osvi = EG(windows_version_info); @@ -53,7 +53,7 @@ BOOL php_win32_console_os_supports_vt100() } -BOOL php_win32_console_handle_is_redirected(DWORD handle_id) +PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; @@ -66,7 +66,7 @@ BOOL php_win32_console_handle_is_redirected(DWORD handle_id) return result; } -BOOL php_win32_console_handle_has_vt100(DWORD handle_id) +PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; @@ -83,7 +83,7 @@ BOOL php_win32_console_handle_has_vt100(DWORD handle_id) return result; } -BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) +PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; diff --git a/win32/console.h b/win32/console.h index f2ab2c37ad515..a6ad1946442fc 100644 --- a/win32/console.h +++ b/win32/console.h @@ -21,6 +21,14 @@ #ifndef PHP_WIN32_CONSOLE_H #define PHP_WIN32_CONSOLE_H +#ifndef PHP_WINUTIL_API +#ifdef PHP_EXPORTS +# define PHP_WINUTIL_API __declspec(dllexport) +#else +# define PHP_WINUTIL_API __declspec(dllimport) +#endif +#endif + #include "php.h" #include "php_streams.h" #include @@ -30,20 +38,20 @@ #endif /* Check if the current Windows version supports VT100 control codes */ -BOOL php_win32_console_os_supports_vt100(); +PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100(); /* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) is redirected to a file */ -BOOL php_win32_console_handle_is_redirected(DWORD handle_id); +PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id); /* Check if the console attached to the specified standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */ -BOOL php_win32_console_handle_has_vt100(DWORD handle_id); +PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id); /* Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console attached to the specified standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) */ -BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); +PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); #endif From 694e207f08b522207f773db8c8c3050539091455 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 4 Oct 2016 14:11:50 +0200 Subject: [PATCH 10/40] Fix x64 build --- ext/standard/streamsfuncs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index cdeb0dfbd414d..49372df858905 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1643,7 +1643,11 @@ PHP_FUNCTION(stream_vt100_support) { zval *z_stream; php_stream *stream; +#ifdef _WIN64 + long long fileno; +#else int fileno; +#endif zend_bool enable; #ifdef PHP_WIN32 DWORD handle_id; From 4f4ffd07e925a3172264b3a31d24524e1ae51ecc Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 4 Oct 2016 15:07:19 +0200 Subject: [PATCH 11/40] Use zend_long instead of long long, use GetConsole instead of GetFinalPathNameByHandleW to check if a handle is a valid console stream --- ext/standard/streamsfuncs.c | 6 +++--- win32/console.c | 7 ++++--- win32/console.h | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 49372df858905..f837323d23d30 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1644,7 +1644,7 @@ PHP_FUNCTION(stream_vt100_support) zval *z_stream; php_stream *stream; #ifdef _WIN64 - long long fileno; + zend_long fileno; #else int fileno; #endif @@ -1697,7 +1697,7 @@ PHP_FUNCTION(stream_vt100_support) RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (php_win32_console_handle_is_redirected(handle_id)) { + if (!php_win32_console_handle_is_console(handle_id)) { RETURN_FALSE; } /* Check if the Windows standard handle has VT100 control codes enabled */ @@ -1727,7 +1727,7 @@ PHP_FUNCTION(stream_vt100_support) RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (php_win32_console_handle_is_redirected(handle_id)) { + if (!php_win32_console_handle_is_console(handle_id)) { RETURN_FALSE; } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ diff --git a/win32/console.c b/win32/console.c index e616e45538bb4..309e519031e84 100644 --- a/win32/console.c +++ b/win32/console.c @@ -53,14 +53,15 @@ PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100() } -PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id) +PHP_WINUTIL_API BOOL php_win32_console_handle_is_console(DWORD handle_id) { BOOL result = FALSE; HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; if (handle != INVALID_HANDLE_VALUE) { - if (GetFinalPathNameByHandleW(handle, NULL, 0, 0) != 0 || GetLastError() == ERROR_INSUFFICIENT_BUFFER) { - result = TRUE; + DWORD mode; + if (GetConsoleMode(handle, &mode)) { + result = TRUE; } } return result; diff --git a/win32/console.h b/win32/console.h index a6ad1946442fc..5811e3bd49b73 100644 --- a/win32/console.h +++ b/win32/console.h @@ -41,8 +41,8 @@ PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100(); /* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) - is redirected to a file */ -PHP_WINUTIL_API BOOL php_win32_console_handle_is_redirected(DWORD handle_id); + is a console (valid handle_id, neither redirected nor piped) */ +PHP_WINUTIL_API BOOL php_win32_console_handle_is_console(DWORD handle_id); /* Check if the console attached to the specified standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the From 3fcdc642763231b96cdea4200524649bb1727fd6 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Tue, 4 Oct 2016 15:19:21 +0200 Subject: [PATCH 12/40] Always use zend_long on any platform --- ext/standard/streamsfuncs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index f837323d23d30..2782cf4eb8d8b 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1643,11 +1643,7 @@ PHP_FUNCTION(stream_vt100_support) { zval *z_stream; php_stream *stream; -#ifdef _WIN64 zend_long fileno; -#else - int fileno; -#endif zend_bool enable; #ifdef PHP_WIN32 DWORD handle_id; From 99bd01e53d780ccc4b24c7e9c744878adee0eeb4 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 5 Oct 2016 08:36:31 +0200 Subject: [PATCH 13/40] Use _get_osfhandle to determine the standard handle --- ext/standard/streamsfuncs.c | 25 ++++--------------------- win32/console.c | 12 ++++++------ win32/console.h | 30 ++++++++++++++++++------------ 3 files changed, 28 insertions(+), 39 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 2782cf4eb8d8b..0704defa55361 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1645,9 +1645,6 @@ PHP_FUNCTION(stream_vt100_support) php_stream *stream; zend_long fileno; zend_bool enable; -#ifdef PHP_WIN32 - DWORD handle_id; -#endif int argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc, "z|b", &z_stream, &enable) == FAILURE) { @@ -1669,20 +1666,6 @@ PHP_FUNCTION(stream_vt100_support) } else { RETURN_FALSE; } - switch (fileno) { - case STDOUT_FILENO: -#ifdef PHP_WIN32 - handle_id = STD_OUTPUT_HANDLE; -#endif - break; - case STDERR_FILENO: -#ifdef PHP_WIN32 - handle_id = STD_ERROR_HANDLE; -#endif - break; - default: - RETURN_FALSE; - } if (argc == 1) { @@ -1693,11 +1676,11 @@ PHP_FUNCTION(stream_vt100_support) RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (!php_win32_console_handle_is_console(handle_id)) { + if (!php_win32_console_fileno_is_console(fileno)) { RETURN_FALSE; } /* Check if the Windows standard handle has VT100 control codes enabled */ - if (php_win32_console_handle_has_vt100(handle_id)) { + if (php_win32_console_fileno_has_vt100(fileno)) { RETURN_TRUE; } else { @@ -1723,11 +1706,11 @@ PHP_FUNCTION(stream_vt100_support) RETURN_FALSE; } /* Check if the Windows standard handle is redirected to file */ - if (!php_win32_console_handle_is_console(handle_id)) { + if (!php_win32_console_fileno_is_console(fileno)) { RETURN_FALSE; } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ - if (php_win32_console_handle_set_vt100(handle_id, enable ? TRUE : FALSE)) { + if (php_win32_console_fileno_set_vt100(fileno, enable ? TRUE : FALSE)) { RETURN_TRUE; } else { diff --git a/win32/console.c b/win32/console.c index 309e519031e84..eefa15ee1b8ed 100644 --- a/win32/console.c +++ b/win32/console.c @@ -53,10 +53,10 @@ PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100() } -PHP_WINUTIL_API BOOL php_win32_console_handle_is_console(DWORD handle_id) +PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno) { BOOL result = FALSE; - HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; + HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { DWORD mode; @@ -67,10 +67,10 @@ PHP_WINUTIL_API BOOL php_win32_console_handle_is_console(DWORD handle_id) return result; } -PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id) +PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno) { BOOL result = FALSE; - HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; + HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { DWORD mode; @@ -84,10 +84,10 @@ PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id) return result; } -PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable) +PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable) { BOOL result = FALSE; - HANDLE handle = handle_id ? GetStdHandle(handle_id) : INVALID_HANDLE_VALUE; + HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { DWORD mode; diff --git a/win32/console.h b/win32/console.h index 5811e3bd49b73..f6cd487b14539 100644 --- a/win32/console.h +++ b/win32/console.h @@ -37,21 +37,27 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif -/* Check if the current Windows version supports VT100 control codes */ +/* +Check if the current Windows version supports VT100 control codes +*/ PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100(); -/* Check if the standard handle (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) - is a console (valid handle_id, neither redirected nor piped) */ -PHP_WINUTIL_API BOOL php_win32_console_handle_is_console(DWORD handle_id); +/* +Check if a file descriptor associated to a stream is a console +(valid fileno, neither redirected nor piped) +*/ +PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno); -/* Check if the console attached to the specified standard handle - (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE) has the - ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */ -PHP_WINUTIL_API BOOL php_win32_console_handle_has_vt100(DWORD handle_id); +/* +Check if the console attached to a file descriptor associated to a +stream is a console has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set +*/ +PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno); -/* Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console - attached to the specified standard handle (STD_OUTPUT_HANDLE, - STD_ERROR_HANDLE) */ -PHP_WINUTIL_API BOOL php_win32_console_handle_set_vt100(DWORD handle_id, BOOL enable); +/* +Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console +attached to a file descriptor associated to a stream +*/ +PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable); #endif From 7b155f48447ed9b07e5a798b13326a6533e5bd77 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 5 Oct 2016 09:21:52 +0200 Subject: [PATCH 14/40] Accept stream names --- ext/standard/streamsfuncs.c | 49 +++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 0704defa55361..ff886216e88e8 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1642,7 +1642,6 @@ PHP_FUNCTION(stream_supports_lock) PHP_FUNCTION(stream_vt100_support) { zval *z_stream; - php_stream *stream; zend_long fileno; zend_bool enable; int argc = ZEND_NUM_ARGS(); @@ -1650,21 +1649,45 @@ PHP_FUNCTION(stream_vt100_support) if (zend_parse_parameters(argc, "z|b", &z_stream, &enable) == FAILURE) { return; } - stream = NULL; + switch (Z_TYPE_P(z_stream)) { case IS_RESOURCE: - php_stream_from_zval_no_verify(stream, z_stream); + { + php_stream *stream = NULL; + php_stream_from_zval_no_verify(stream, z_stream); + if (stream == NULL) { + RETURN_FALSE; + } + if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); + } + else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); + } + else { + RETURN_FALSE; + } + } break; - } - if (stream == NULL) { - RETURN_FALSE; - } - if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { - php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); - } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { - php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); - } else { - RETURN_FALSE; + case IS_STRING: + { + zend_string *stream_name = Z_STR_P(z_stream); + if (strcmp(ZSTR_VAL(stream_name), "php://stdin") == 0) { + fileno = STDIN_FILENO; + } + else if (strcmp(ZSTR_VAL(stream_name), "php://stdout") == 0) { + fileno = STDOUT_FILENO; + } + else if (strcmp(ZSTR_VAL(stream_name), "php://stderr") == 0) { + fileno = STDERR_FILENO; + } + else { + RETURN_FALSE; + } + } + break; + default: + RETURN_FALSE; } From 08e75a2a31ec8ce78540d8dbab3a567849683d28 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Wed, 5 Oct 2016 12:32:38 +0200 Subject: [PATCH 15/40] Raise warnings in case of invalid stream parameter --- ext/standard/streamsfuncs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index ff886216e88e8..9c12d936662a5 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1682,11 +1682,24 @@ PHP_FUNCTION(stream_vt100_support) fileno = STDERR_FILENO; } else { + zend_internal_type_error( + ZEND_ARG_USES_STRICT_TYPES(), + "%s() was not able to recognize the stream named %s", + get_active_function_name(), + ZSTR_VAL(stream_name) + ); RETURN_FALSE; } } break; default: + zend_internal_type_error( + ZEND_ARG_USES_STRICT_TYPES(), + "%s() expects parameter %d to be a resource or a stream name, %s given", + get_active_function_name(), + 1, + zend_zval_type_name(z_stream) + ); RETURN_FALSE; } From c10467eaacca7f48c3fa4b03c7237ee00ba605b7 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 11:07:05 +0200 Subject: [PATCH 16/40] Return true if disabling VT100 support on a not-console/redirected stream or on old Windows versions --- ext/standard/streamsfuncs.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 9c12d936662a5..827d634294b44 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1739,11 +1739,21 @@ PHP_FUNCTION(stream_vt100_support) #ifdef PHP_WIN32 /* Check if the current Windows version supports VT100 control codes */ if (!php_win32_console_os_supports_vt100()) { - RETURN_FALSE; + if (enable) { + RETURN_FALSE; + } + else { + RETURN_TRUE; + } } /* Check if the Windows standard handle is redirected to file */ if (!php_win32_console_fileno_is_console(fileno)) { - RETURN_FALSE; + if (enable) { + RETURN_FALSE; + } + else { + RETURN_TRUE; + } } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ if (php_win32_console_fileno_set_vt100(fileno, enable ? TRUE : FALSE)) { From dd858250b794be84be7ba7721503d851dc6b3bcf Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 11:45:26 +0200 Subject: [PATCH 17/40] Remove php_win32_console_os_supports_vt100 --- ext/standard/streamsfuncs.c | 30 ++++++++++++++++-------------- win32/console.c | 32 -------------------------------- win32/console.h | 4 ---- 3 files changed, 16 insertions(+), 50 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 827d634294b44..1c28391807156 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1707,10 +1707,6 @@ PHP_FUNCTION(stream_vt100_support) if (argc == 1) { /* Check if the specified stream supports VT100 control codes */ #ifdef PHP_WIN32 - /* Check if the current Windows version supports VT100 control codes */ - if (!php_win32_console_os_supports_vt100()) { - RETURN_FALSE; - } /* Check if the Windows standard handle is redirected to file */ if (!php_win32_console_fileno_is_console(fileno)) { RETURN_FALSE; @@ -1737,15 +1733,6 @@ PHP_FUNCTION(stream_vt100_support) else { /* Enable/disable VT100 control codes support for the specified stream */ #ifdef PHP_WIN32 - /* Check if the current Windows version supports VT100 control codes */ - if (!php_win32_console_os_supports_vt100()) { - if (enable) { - RETURN_FALSE; - } - else { - RETURN_TRUE; - } - } /* Check if the Windows standard handle is redirected to file */ if (!php_win32_console_fileno_is_console(fileno)) { if (enable) { @@ -1760,7 +1747,22 @@ PHP_FUNCTION(stream_vt100_support) RETURN_TRUE; } else { - RETURN_FALSE; + if (php_win32_console_fileno_has_vt100(fileno)) { + if (enable) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } + } + else { + if (enable) { + RETURN_FALSE; + } + else { + RETURN_TRUE; + } + } } #elif HAVE_POSIX /* Check if the file descriptor identifier is a terminal */ diff --git a/win32/console.c b/win32/console.c index eefa15ee1b8ed..0de18c71c0600 100644 --- a/win32/console.c +++ b/win32/console.c @@ -20,38 +20,6 @@ #include "win32/console.h" -PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100() -{ - const DWORD MINV_MAJOR = 10, MINV_MINOR = 0, MINV_BUILD = 10586; - OSVERSIONINFOEX osvi = EG(windows_version_info); - // Check operating system platform - if (osvi.dwPlatformId != VER_PLATFORM_WIN32_NT) { - return FALSE; - } - // Check major version number - if (osvi.dwMajorVersion > MINV_MAJOR) { - return TRUE; - } - if (osvi.dwMajorVersion < MINV_MAJOR) { - return FALSE; - } - // Check minor version number - if (osvi.dwMinorVersion > MINV_MINOR) { - return TRUE; - } - if (osvi.dwMinorVersion < MINV_MINOR) { - return FALSE; - } - // Check build number - if (osvi.dwBuildNumber > MINV_BUILD) { - return TRUE; - } - if (osvi.dwBuildNumber < MINV_BUILD) { - return FALSE; - } - return TRUE; - -} PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno) { diff --git a/win32/console.h b/win32/console.h index f6cd487b14539..2a976ce228d00 100644 --- a/win32/console.h +++ b/win32/console.h @@ -37,10 +37,6 @@ #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif -/* -Check if the current Windows version supports VT100 control codes -*/ -PHP_WINUTIL_API BOOL php_win32_console_os_supports_vt100(); /* Check if a file descriptor associated to a stream is a console From a6e88f6c625fb7c50867811e0f716cac475aac9d Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:23:13 +0200 Subject: [PATCH 18/40] Differentiate stdin vs stdout/stderr --- win32/console.c | 18 +++++++++++++++++- win32/console.h | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/win32/console.c b/win32/console.c index 0de18c71c0600..02501cde8a011 100644 --- a/win32/console.c +++ b/win32/console.c @@ -41,10 +41,18 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno) HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { + DWORD cNumberOfEvents; + DWORD flag; DWORD mode; + if (GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + flag = ENABLE_VIRTUAL_TERMINAL_INPUT; + } + else { + flag = ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } if (GetConsoleMode(handle, &mode)) { - if (mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) { + if (mode & flag) { result = TRUE; } } @@ -58,8 +66,16 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { + DWORD cNumberOfEvents; + DWORD flag; DWORD mode; + if (GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + flag = ENABLE_VIRTUAL_TERMINAL_INPUT; + } + else { + flag = ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } if (GetConsoleMode(handle, &mode)) { if (((mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) ? 1 : 0) == (enable ? 1 : 0)) { result = TRUE; diff --git a/win32/console.h b/win32/console.h index 2a976ce228d00..18db4695579c4 100644 --- a/win32/console.h +++ b/win32/console.h @@ -33,6 +33,10 @@ #include "php_streams.h" #include +#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT +#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200 +#endif + #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif From 1643715dba79709af1f8d23a6cce55c62f3271e3 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:24:17 +0200 Subject: [PATCH 19/40] Simplify setting flag --- win32/console.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/win32/console.c b/win32/console.c index 02501cde8a011..8788a689e0524 100644 --- a/win32/console.c +++ b/win32/console.c @@ -77,17 +77,18 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e flag = ENABLE_VIRTUAL_TERMINAL_PROCESSING; } if (GetConsoleMode(handle, &mode)) { - if (((mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) ? 1 : 0) == (enable ? 1 : 0)) { + DWORD newMode; + if (enable) { + newMode = mode | flag; + } + else { + newMode = mode & ~flag; + } + if (newMode == mode) { result = TRUE; } else { - if (enable) { - mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - } - else { - mode &= ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; - } - if (SetConsoleMode(handle, mode)) { + if (SetConsoleMode(handle, newMode)) { result = TRUE; } } From f86567e092b52e968dbe6da7a146df93f4776795 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:34:27 +0200 Subject: [PATCH 20/40] Allow avoid piping STDIN --- run-tests.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/run-tests.php b/run-tests.php index d1ad779d3cfa6..312b60acb56e9 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1062,7 +1062,7 @@ function error_report($testname, $logname, $tested) } } -function system_with_timeout($commandline, $env = null, $stdin = null, $captureStdOut = true, $captureStdErr = true) +function system_with_timeout($commandline, $env = null, $stdin = null, $captureStdIn = true, $captureStdOut = true, $captureStdErr = true) { global $leak_check, $cwd; @@ -1073,8 +1073,9 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS $bin_env[$key] = $value; } - $descriptorspec = array( - 0 => array('pipe', 'r'), + $descriptorspec = array(); + if ($captureStdIn) { + $descriptorspec[0] = array('pipe', 'r'); ); if ($captureStdOut) { $descriptorspec[1] = array('pipe', 'w'); @@ -1088,11 +1089,13 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS return false; } - if (!is_null($stdin)) { - fwrite($pipes[0], $stdin); + if ($captureStdIn) { + if (!is_null($stdin)) { + fwrite($pipes[0], $stdin); + } + fclose($pipes[0]); + unset($pipes[0]); } - fclose($pipes[0]); - unset($pipes[0]); $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60); @@ -1350,9 +1353,11 @@ function run_test($php, $file, $env) } if (isset($section_text['CAPTURE_STDIO'])) { + $captureStdIn = stripos($section_text['CAPTURE_STDIO'], 'STDIN') !== false; $captureStdOut = stripos($section_text['CAPTURE_STDIO'], 'STDOUT') !== false; $captureStdErr = stripos($section_text['CAPTURE_STDIO'], 'STDERR') !== false; } else { + $captureStdIn = true; $captureStdOut = true; $captureStdErr = true; } @@ -1360,7 +1365,7 @@ function run_test($php, $file, $env) $cmdRedirect = ' 2>&1'; } else { $cmdRedirect = ''; - } + } $tested = trim($section_text['TEST']); @@ -1897,7 +1902,7 @@ function run_test($php, $file, $env) junit_start_timer($shortname); - $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null, $captureStdOut, $captureStdErr); + $out = system_with_timeout($cmd, $env, isset($section_text['STDIN']) ? $section_text['STDIN'] : null, $captureStdIn, $captureStdOut, $captureStdErr); junit_finish_timer($shortname); From 658ff84caf28be9d17afec5f2632b4075ba1caf5 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:46:01 +0200 Subject: [PATCH 21/40] Let stream_vt100_support accept only resources --- ext/standard/streamsfuncs.c | 77 ++++++++++--------------------------- 1 file changed, 21 insertions(+), 56 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 1c28391807156..030c357288a34 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1641,68 +1641,33 @@ PHP_FUNCTION(stream_supports_lock) */ PHP_FUNCTION(stream_vt100_support) { - zval *z_stream; - zend_long fileno; + zval *zsrc; + php_stream *stream; zend_bool enable; + zend_long fileno; + int argc = ZEND_NUM_ARGS(); - if (zend_parse_parameters(argc, "z|b", &z_stream, &enable) == FAILURE) { - return; + if (zend_parse_parameters(argc, "r|b", &zsrc, &enable) == FAILURE) { + RETURN_FALSE; } - switch (Z_TYPE_P(z_stream)) { - case IS_RESOURCE: - { - php_stream *stream = NULL; - php_stream_from_zval_no_verify(stream, z_stream); - if (stream == NULL) { - RETURN_FALSE; - } - if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { - php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); - } - else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { - php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); - } - else { - RETURN_FALSE; - } - } - break; - case IS_STRING: - { - zend_string *stream_name = Z_STR_P(z_stream); - if (strcmp(ZSTR_VAL(stream_name), "php://stdin") == 0) { - fileno = STDIN_FILENO; - } - else if (strcmp(ZSTR_VAL(stream_name), "php://stdout") == 0) { - fileno = STDOUT_FILENO; - } - else if (strcmp(ZSTR_VAL(stream_name), "php://stderr") == 0) { - fileno = STDERR_FILENO; - } - else { - zend_internal_type_error( - ZEND_ARG_USES_STRICT_TYPES(), - "%s() was not able to recognize the stream named %s", - get_active_function_name(), - ZSTR_VAL(stream_name) - ); - RETURN_FALSE; - } - } - break; - default: - zend_internal_type_error( - ZEND_ARG_USES_STRICT_TYPES(), - "%s() expects parameter %d to be a resource or a stream name, %s given", - get_active_function_name(), - 1, - zend_zval_type_name(z_stream) - ); - RETURN_FALSE; - } + php_stream_from_zval(stream, zsrc); + if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); + } + else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); + } + else { + zend_internal_type_error( + ZEND_ARG_USES_STRICT_TYPES(), + "%s() was not able to analyze the specified stream", + get_active_function_name() + ); + RETURN_FALSE; + } if (argc == 1) { /* Check if the specified stream supports VT100 control codes */ From d9e053116f30b992fd8a4a01860ac68736f11c1b Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:47:57 +0200 Subject: [PATCH 22/40] Fix run-tests --- run-tests.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 312b60acb56e9..ddfc635933dcb 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1076,7 +1076,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS $descriptorspec = array(); if ($captureStdIn) { $descriptorspec[0] = array('pipe', 'r'); - ); + } if ($captureStdOut) { $descriptorspec[1] = array('pipe', 'w'); } From 157f8e86bd85b2415d1035e6dce62fdb638126fe Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 6 Oct 2016 18:57:37 +0200 Subject: [PATCH 23/40] Revert console flags in case of failure --- win32/console.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win32/console.c b/win32/console.c index 8788a689e0524..b494c9ab031f2 100644 --- a/win32/console.c +++ b/win32/console.c @@ -91,6 +91,11 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e if (SetConsoleMode(handle, newMode)) { result = TRUE; } + else { + // SetConsoleMode sets the flags even if it fails, so let's revert them back + // (otherwise subsequent calls to GetConsoleMode will receive the new (invalid) flags + SetConsoleMode(handle, mode); + } } } } From 76411a4a6a9aa78505a03fcc2d81842cf8886076 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 7 Oct 2016 08:05:38 +0200 Subject: [PATCH 24/40] Simplify logic of stream_vt100_support when setting the flag Return true if succeeded, false otherwise --- ext/standard/streamsfuncs.c | 42 ++----------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 030c357288a34..7e1f9ac147503 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1700,52 +1700,14 @@ PHP_FUNCTION(stream_vt100_support) #ifdef PHP_WIN32 /* Check if the Windows standard handle is redirected to file */ if (!php_win32_console_fileno_is_console(fileno)) { - if (enable) { - RETURN_FALSE; - } - else { - RETURN_TRUE; - } + RETURN_FALSE; } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ if (php_win32_console_fileno_set_vt100(fileno, enable ? TRUE : FALSE)) { RETURN_TRUE; } else { - if (php_win32_console_fileno_has_vt100(fileno)) { - if (enable) { - RETURN_TRUE; - } - else { - RETURN_FALSE; - } - } - else { - if (enable) { - RETURN_FALSE; - } - else { - RETURN_TRUE; - } - } - } -#elif HAVE_POSIX - /* Check if the file descriptor identifier is a terminal */ - if (isatty(fileno)) { - if (enable) { - RETURN_TRUE; - } - else { - RETURN_FALSE; - } - } - else { - if (enable) { - RETURN_FALSE; - } - else { - RETURN_TRUE; - } + RETURN_FALSE; } #else RETURN_FALSE; From 4d956f25b10b0c78dda0f535bcd0b8ce9ace6f19 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 7 Oct 2016 08:16:38 +0200 Subject: [PATCH 25/40] Drop support for STDIN --- win32/console.c | 65 +++++++++++++++++++++++-------------------------- win32/console.h | 12 +++------ 2 files changed, 34 insertions(+), 43 deletions(-) diff --git a/win32/console.c b/win32/console.c index b494c9ab031f2..91407368beedc 100644 --- a/win32/console.c +++ b/win32/console.c @@ -42,18 +42,15 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno) if (handle != INVALID_HANDLE_VALUE) { DWORD cNumberOfEvents; - DWORD flag; - DWORD mode; - if (GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { - flag = ENABLE_VIRTUAL_TERMINAL_INPUT; - } - else { - flag = ENABLE_VIRTUAL_TERMINAL_PROCESSING; - } - if (GetConsoleMode(handle, &mode)) { - if (mode & flag) { - result = TRUE; + if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + // Not STDIN + DWORD mode; + + if (GetConsoleMode(handle, &mode)) { + if (mode & ENABLE_VIRTUAL_TERMINAL_PROCESSING) { + result = TRUE; + } } } } @@ -67,34 +64,32 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e if (handle != INVALID_HANDLE_VALUE) { DWORD cNumberOfEvents; - DWORD flag; - DWORD mode; - if (GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { - flag = ENABLE_VIRTUAL_TERMINAL_INPUT; - } - else { - flag = ENABLE_VIRTUAL_TERMINAL_PROCESSING; - } - if (GetConsoleMode(handle, &mode)) { - DWORD newMode; - if (enable) { - newMode = mode | flag; - } - else { - newMode = mode & ~flag; - } - if (newMode == mode) { - result = TRUE; - } - else { - if (SetConsoleMode(handle, newMode)) { + if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + // Not STDIN + DWORD mode; + + if (GetConsoleMode(handle, &mode)) { + DWORD newMode; + + if (enable) { + newMode = mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } + else { + newMode = mode & ~ENABLE_VIRTUAL_TERMINAL_PROCESSING; + } + if (newMode == mode) { result = TRUE; } else { - // SetConsoleMode sets the flags even if it fails, so let's revert them back - // (otherwise subsequent calls to GetConsoleMode will receive the new (invalid) flags - SetConsoleMode(handle, mode); + if (SetConsoleMode(handle, newMode)) { + result = TRUE; + } + else { + // SetConsoleMode sets the flags even if it fails, so let's revert them back + // (otherwise subsequent calls to GetConsoleMode will receive the new (invalid) flags + SetConsoleMode(handle, mode); + } } } } diff --git a/win32/console.h b/win32/console.h index 18db4695579c4..e32bf04c32826 100644 --- a/win32/console.h +++ b/win32/console.h @@ -33,10 +33,6 @@ #include "php_streams.h" #include -#ifndef ENABLE_VIRTUAL_TERMINAL_INPUT -#define ENABLE_VIRTUAL_TERMINAL_INPUT 0x0200 -#endif - #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif @@ -49,14 +45,14 @@ Check if a file descriptor associated to a stream is a console PHP_WINUTIL_API BOOL php_win32_console_fileno_is_console(zend_long fileno); /* -Check if the console attached to a file descriptor associated to a -stream is a console has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set +Check if the console attached to a file descriptor (screen buffer, not STDIN) +has the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag set */ PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno); /* -Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the console -attached to a file descriptor associated to a stream +Set/unset the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for the screen buffer (STDOUT/STDERR) +associated to a file descriptor */ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL enable); From 7d348a04049f101719ee27597e12109cafdca63a Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 7 Oct 2016 17:05:53 +0200 Subject: [PATCH 26/40] More comprehensive tests for stream_vt100_support --- tests/output/vt100_support.php | 65 ++++++++ tests/output/vt100_support_posix_err.phpt | 140 +++++++++++++++++ tests/output/vt100_support_posix_in-err.phpt | 140 +++++++++++++++++ .../vt100_support_posix_in-out-err.phpt | 140 +++++++++++++++++ tests/output/vt100_support_posix_in-out.phpt | 140 +++++++++++++++++ tests/output/vt100_support_posix_out-err.phpt | 140 +++++++++++++++++ tests/output/vt100_support_posix_out.phpt | 140 +++++++++++++++++ ...t100_support_win_supported_redirected.phpt | 25 --- .../vt100_support_win_supported_stderr.phpt | 27 ---- .../vt100_support_win_supported_stdout.phpt | 30 ---- .../output/vt100_support_win_unsupported.phpt | 25 --- tests/output/vt100_support_winko_err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winko_in-err.phpt | 145 ++++++++++++++++++ .../vt100_support_winko_in-out-err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winko_in-out.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winko_out-err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winko_out.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winok_err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winok_in-err.phpt | 145 ++++++++++++++++++ .../vt100_support_winok_in-out-err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winok_in-out.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winok_out-err.phpt | 145 ++++++++++++++++++ tests/output/vt100_support_winok_out.phpt | 145 ++++++++++++++++++ 23 files changed, 2645 insertions(+), 107 deletions(-) create mode 100644 tests/output/vt100_support.php create mode 100644 tests/output/vt100_support_posix_err.phpt create mode 100644 tests/output/vt100_support_posix_in-err.phpt create mode 100644 tests/output/vt100_support_posix_in-out-err.phpt create mode 100644 tests/output/vt100_support_posix_in-out.phpt create mode 100644 tests/output/vt100_support_posix_out-err.phpt create mode 100644 tests/output/vt100_support_posix_out.phpt delete mode 100644 tests/output/vt100_support_win_supported_redirected.phpt delete mode 100644 tests/output/vt100_support_win_supported_stderr.phpt delete mode 100644 tests/output/vt100_support_win_supported_stdout.phpt delete mode 100644 tests/output/vt100_support_win_unsupported.phpt create mode 100644 tests/output/vt100_support_winko_err.phpt create mode 100644 tests/output/vt100_support_winko_in-err.phpt create mode 100644 tests/output/vt100_support_winko_in-out-err.phpt create mode 100644 tests/output/vt100_support_winko_in-out.phpt create mode 100644 tests/output/vt100_support_winko_out-err.phpt create mode 100644 tests/output/vt100_support_winko_out.phpt create mode 100644 tests/output/vt100_support_winok_err.phpt create mode 100644 tests/output/vt100_support_winok_in-err.phpt create mode 100644 tests/output/vt100_support_winok_in-out-err.phpt create mode 100644 tests/output/vt100_support_winok_in-out.phpt create mode 100644 tests/output/vt100_support_winok_out-err.phpt create mode 100644 tests/output/vt100_support_winok_out.phpt diff --git a/tests/output/vt100_support.php b/tests/output/vt100_support.php new file mode 100644 index 0000000000000..723edf28b63be --- /dev/null +++ b/tests/output/vt100_support.php @@ -0,0 +1,65 @@ + STDIN, + 'STDIN (fopen)' => fopen('php://stdin', 'rb'), + 'STDIN (php://fd/0)' => fopen('php://fd/0', 'rb'), + 'STDOUT (constant)' => STDOUT, + 'STDOUT (fopen)' => fopen('php://stdout', 'wb'), + 'STDOUT (php://fd/1)' => fopen('php://fd/1', 'wb'), + 'STDERR (constant)' => STDERR, + 'STDERR (fopen)' => fopen('php://stderr', 'wb'), + 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), + 'Not a stream' => 'foo', + 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), + 'Invalid stream (php://input)' => fopen('php://input', 'wb'), + 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), + 'File stream' => $closeMe = fopen(__FILE__, 'rb'), + ); + + foreach ($sampleStreams as $name => $stream) { + echo "$name:\n"; + echo "- current value : "; var_dump(stream_vt100_support($stream)); + echo "- enabling VT100 : "; var_dump(stream_vt100_support($stream, true)); + echo "- current value : "; var_dump(stream_vt100_support($stream)); + echo "- disabling VT100: "; var_dump(stream_vt100_support($stream, false)); + echo "- current value : "; var_dump(stream_vt100_support($stream)); + } + + fclose($closeMe); + restoreVT100State($state); +} + +function testVT100ToStdErr() +{ + ob_start(); + testVT100ToStdOut(); + $result = ob_get_contents(); + ob_end_clean(); + fwrite(STDERR, $result); +} diff --git a/tests/output/vt100_support_posix_err.phpt b/tests/output/vt100_support_posix_err.phpt new file mode 100644 index 0000000000000..995a2a56bc20d --- /dev/null +++ b/tests/output/vt100_support_posix_err.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDERR +--SKIPIF-- + +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (php://fd/0): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (php://fd/1): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-err.phpt b/tests/output/vt100_support_posix_in-err.phpt new file mode 100644 index 0000000000000..1a2d2139f2b3b --- /dev/null +++ b/tests/output/vt100_support_posix_in-err.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDIN/STDERR +--SKIPIF-- + +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (php://fd/1): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-out-err.phpt b/tests/output/vt100_support_posix_in-out-err.phpt new file mode 100644 index 0000000000000..1a889c73fb8c4 --- /dev/null +++ b/tests/output/vt100_support_posix_in-out-err.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDIN/STDOUT/STDERR +--SKIPIF-- + +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-out.phpt b/tests/output/vt100_support_posix_in-out.phpt new file mode 100644 index 0000000000000..3d3326746bfc2 --- /dev/null +++ b/tests/output/vt100_support_posix_in-out.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDIN/STDOUT +--SKIPIF-- + +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (php://fd/2): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_posix_out-err.phpt b/tests/output/vt100_support_posix_out-err.phpt new file mode 100644 index 0000000000000..014818944f855 --- /dev/null +++ b/tests/output/vt100_support_posix_out-err.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDOUT/STDERR +--SKIPIF-- + +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (php://fd/0): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_posix_out.phpt b/tests/output/vt100_support_posix_out.phpt new file mode 100644 index 0000000000000..62a21834beb9a --- /dev/null +++ b/tests/output/vt100_support_posix_out.phpt @@ -0,0 +1,140 @@ +--TEST-- +Test stream_vt100_support on POSIX with redirected STDOUT +--SKIPIF-- + +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDIN (php://fd/0): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (fopen): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +STDERR (php://fd/2): +- current value : bool(true) +- enabling VT100 : bool(false) +- current value : bool(true) +- disabling VT100: bool(false) +- current value : bool(true) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_win_supported_redirected.phpt b/tests/output/vt100_support_win_supported_redirected.phpt deleted file mode 100644 index 8a8a60f363b92..0000000000000 --- a/tests/output/vt100_support_win_supported_redirected.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDIO/STDERR ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT, STDERR ---FILE-- - ---EXPECT-- -bool(false) -bool(false) diff --git a/tests/output/vt100_support_win_supported_stderr.phpt b/tests/output/vt100_support_win_supported_stderr.phpt deleted file mode 100644 index 44e6b4a5b2663..0000000000000 --- a/tests/output/vt100_support_win_supported_stderr.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -Test stream_vt100_support for STDERR on newer Windows versions ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(false) diff --git a/tests/output/vt100_support_win_supported_stdout.phpt b/tests/output/vt100_support_win_supported_stdout.phpt deleted file mode 100644 index 09d1e64d67566..0000000000000 --- a/tests/output/vt100_support_win_supported_stdout.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -Test stream_vt100_support for STDOUT on newer Windows versions ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDERR ---FILE-- - ---EXPECT-- -bool(true) -bool(true) -bool(true) -bool(false) diff --git a/tests/output/vt100_support_win_unsupported.phpt b/tests/output/vt100_support_win_unsupported.phpt deleted file mode 100644 index 62294430d6b9e..0000000000000 --- a/tests/output/vt100_support_win_unsupported.phpt +++ /dev/null @@ -1,25 +0,0 @@ ---TEST-- -Test stream_vt100_support for older Windows versions ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECT-- -bool(false) -bool(false) -bool(false) diff --git a/tests/output/vt100_support_winko_err.phpt b/tests/output/vt100_support_winko_err.phpt new file mode 100644 index 0000000000000..de320ecffec19 --- /dev/null +++ b/tests/output/vt100_support_winko_err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-err.phpt b/tests/output/vt100_support_winko_in-err.phpt new file mode 100644 index 0000000000000..93f5125ff3895 --- /dev/null +++ b/tests/output/vt100_support_winko_in-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDIN/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-out-err.phpt b/tests/output/vt100_support_winko_in-out-err.phpt new file mode 100644 index 0000000000000..94473e1869880 --- /dev/null +++ b/tests/output/vt100_support_winko_in-out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDIN/STDOUT/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-out.phpt b/tests/output/vt100_support_winko_in-out.phpt new file mode 100644 index 0000000000000..d6cc50321e327 --- /dev/null +++ b/tests/output/vt100_support_winko_in-out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDIN/STDOUT +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winko_out-err.phpt b/tests/output/vt100_support_winko_out-err.phpt new file mode 100644 index 0000000000000..ba017455f98a4 --- /dev/null +++ b/tests/output/vt100_support_winko_out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDOUT/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winko_out.phpt b/tests/output/vt100_support_winko_out.phpt new file mode 100644 index 0000000000000..936051e454435 --- /dev/null +++ b/tests/output/vt100_support_winko_out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on older Windows versions with redirected STDOUT +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_err.phpt b/tests/output/vt100_support_winok_err.phpt new file mode 100644 index 0000000000000..78906dd0d7811 --- /dev/null +++ b/tests/output/vt100_support_winok_err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-err.phpt b/tests/output/vt100_support_winok_in-err.phpt new file mode 100644 index 0000000000000..1e183b44a5e9b --- /dev/null +++ b/tests/output/vt100_support_winok_in-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDIN/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-out-err.phpt b/tests/output/vt100_support_winok_in-out-err.phpt new file mode 100644 index 0000000000000..eb6d24fb458eb --- /dev/null +++ b/tests/output/vt100_support_winok_in-out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDIN/STDOUT/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-out.phpt b/tests/output/vt100_support_winok_in-out.phpt new file mode 100644 index 0000000000000..aa956389efdd2 --- /dev/null +++ b/tests/output/vt100_support_winok_in-out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDIN/STDOUT +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_out-err.phpt b/tests/output/vt100_support_winok_out-err.phpt new file mode 100644 index 0000000000000..b513583e5baf1 --- /dev/null +++ b/tests/output/vt100_support_winok_out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDOUT/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/vt100_support_winok_out.phpt b/tests/output/vt100_support_winok_out.phpt new file mode 100644 index 0000000000000..d9bde717d51e9 --- /dev/null +++ b/tests/output/vt100_support_winok_out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test stream_vt100_support on newer Windows versions with redirected STDOUT +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) From 4588b5072ad60182dd164f795fea50bd8df5612c Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sat, 8 Oct 2016 21:04:52 +0200 Subject: [PATCH 27/40] Remove old tests --- ...vt100_support_posix_redirected_stderr.phpt | 21 ------------------- ...vt100_support_posix_redirected_stdout.phpt | 18 ---------------- 2 files changed, 39 deletions(-) delete mode 100644 tests/output/vt100_support_posix_redirected_stderr.phpt delete mode 100644 tests/output/vt100_support_posix_redirected_stdout.phpt diff --git a/tests/output/vt100_support_posix_redirected_stderr.phpt b/tests/output/vt100_support_posix_redirected_stderr.phpt deleted file mode 100644 index 9bba5489e31fe..0000000000000 --- a/tests/output/vt100_support_posix_redirected_stderr.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDERR ---SKIPIF-- - ---CAPTURE_STDIO-- -STDERR ---FILE-- - ---EXPECT-- -bool(true) -bool(false) diff --git a/tests/output/vt100_support_posix_redirected_stdout.phpt b/tests/output/vt100_support_posix_redirected_stdout.phpt deleted file mode 100644 index feef083a264f6..0000000000000 --- a/tests/output/vt100_support_posix_redirected_stdout.phpt +++ /dev/null @@ -1,18 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDOUT ---SKIPIF-- - ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECT-- -bool(false) -bool(true) From bf60a7880407c92b1b0bace0d1d48b6b5e777b9a Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sat, 8 Oct 2016 21:05:32 +0200 Subject: [PATCH 28/40] Fix name of included file and use absolute paths --- tests/output/{vt100_support.php => vt100_support.inc} | 0 tests/output/vt100_support_posix_err.phpt | 2 +- tests/output/vt100_support_posix_in-err.phpt | 2 +- tests/output/vt100_support_posix_in-out-err.phpt | 2 +- tests/output/vt100_support_posix_in-out.phpt | 2 +- tests/output/vt100_support_posix_out-err.phpt | 2 +- tests/output/vt100_support_posix_out.phpt | 2 +- tests/output/vt100_support_winko_err.phpt | 2 +- tests/output/vt100_support_winko_in-err.phpt | 2 +- tests/output/vt100_support_winko_in-out-err.phpt | 2 +- tests/output/vt100_support_winko_in-out.phpt | 2 +- tests/output/vt100_support_winko_out-err.phpt | 2 +- tests/output/vt100_support_winko_out.phpt | 2 +- tests/output/vt100_support_winok_err.phpt | 2 +- tests/output/vt100_support_winok_in-err.phpt | 2 +- tests/output/vt100_support_winok_in-out-err.phpt | 2 +- tests/output/vt100_support_winok_in-out.phpt | 2 +- tests/output/vt100_support_winok_out-err.phpt | 2 +- tests/output/vt100_support_winok_out.phpt | 2 +- 19 files changed, 18 insertions(+), 18 deletions(-) rename tests/output/{vt100_support.php => vt100_support.inc} (100%) diff --git a/tests/output/vt100_support.php b/tests/output/vt100_support.inc similarity index 100% rename from tests/output/vt100_support.php rename to tests/output/vt100_support.inc diff --git a/tests/output/vt100_support_posix_err.phpt b/tests/output/vt100_support_posix_err.phpt index 995a2a56bc20d..07d08a5c3ef55 100644 --- a/tests/output/vt100_support_posix_err.phpt +++ b/tests/output/vt100_support_posix_err.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_posix_in-err.phpt b/tests/output/vt100_support_posix_in-err.phpt index 1a2d2139f2b3b..fdeb4885150b7 100644 --- a/tests/output/vt100_support_posix_in-err.phpt +++ b/tests/output/vt100_support_posix_in-err.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDIN STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_posix_in-out-err.phpt b/tests/output/vt100_support_posix_in-out-err.phpt index 1a889c73fb8c4..fc2ad85852d74 100644 --- a/tests/output/vt100_support_posix_in-out-err.phpt +++ b/tests/output/vt100_support_posix_in-out-err.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDIN STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_posix_in-out.phpt b/tests/output/vt100_support_posix_in-out.phpt index 3d3326746bfc2..65efc63878758 100644 --- a/tests/output/vt100_support_posix_in-out.phpt +++ b/tests/output/vt100_support_posix_in-out.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDIN STDOUT --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_posix_out-err.phpt b/tests/output/vt100_support_posix_out-err.phpt index 014818944f855..4b2ef5b15319e 100644 --- a/tests/output/vt100_support_posix_out-err.phpt +++ b/tests/output/vt100_support_posix_out-err.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_posix_out.phpt b/tests/output/vt100_support_posix_out.phpt index 62a21834beb9a..2824101157d49 100644 --- a/tests/output/vt100_support_posix_out.phpt +++ b/tests/output/vt100_support_posix_out.phpt @@ -10,7 +10,7 @@ if (!function_exists('posix_isatty')) { STDOUT --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_err.phpt b/tests/output/vt100_support_winko_err.phpt index de320ecffec19..468265b152e7c 100644 --- a/tests/output/vt100_support_winko_err.phpt +++ b/tests/output/vt100_support_winko_err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_in-err.phpt b/tests/output/vt100_support_winko_in-err.phpt index 93f5125ff3895..302807fa0108e 100644 --- a/tests/output/vt100_support_winko_in-err.phpt +++ b/tests/output/vt100_support_winko_in-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_in-out-err.phpt b/tests/output/vt100_support_winko_in-out-err.phpt index 94473e1869880..ca01445ff68a6 100644 --- a/tests/output/vt100_support_winko_in-out-err.phpt +++ b/tests/output/vt100_support_winko_in-out-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_in-out.phpt b/tests/output/vt100_support_winko_in-out.phpt index d6cc50321e327..b5cf8f3a71e5e 100644 --- a/tests/output/vt100_support_winko_in-out.phpt +++ b/tests/output/vt100_support_winko_in-out.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDOUT --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_out-err.phpt b/tests/output/vt100_support_winko_out-err.phpt index ba017455f98a4..15344d88e4a1f 100644 --- a/tests/output/vt100_support_winko_out-err.phpt +++ b/tests/output/vt100_support_winko_out-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winko_out.phpt b/tests/output/vt100_support_winko_out.phpt index 936051e454435..073d98ce0fc2a 100644 --- a/tests/output/vt100_support_winko_out.phpt +++ b/tests/output/vt100_support_winko_out.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDOUT --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_err.phpt b/tests/output/vt100_support_winok_err.phpt index 78906dd0d7811..3e2950950c78f 100644 --- a/tests/output/vt100_support_winok_err.phpt +++ b/tests/output/vt100_support_winok_err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_in-err.phpt b/tests/output/vt100_support_winok_in-err.phpt index 1e183b44a5e9b..06e91d03c344b 100644 --- a/tests/output/vt100_support_winok_in-err.phpt +++ b/tests/output/vt100_support_winok_in-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_in-out-err.phpt b/tests/output/vt100_support_winok_in-out-err.phpt index eb6d24fb458eb..10f35d396a6ed 100644 --- a/tests/output/vt100_support_winok_in-out-err.phpt +++ b/tests/output/vt100_support_winok_in-out-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_in-out.phpt b/tests/output/vt100_support_winok_in-out.phpt index aa956389efdd2..086f7c0753446 100644 --- a/tests/output/vt100_support_winok_in-out.phpt +++ b/tests/output/vt100_support_winok_in-out.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDIN STDOUT --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_out-err.phpt b/tests/output/vt100_support_winok_out-err.phpt index b513583e5baf1..35252f81a6930 100644 --- a/tests/output/vt100_support_winok_out-err.phpt +++ b/tests/output/vt100_support_winok_out-err.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDOUT STDERR --FILE-- --EXPECTF-- diff --git a/tests/output/vt100_support_winok_out.phpt b/tests/output/vt100_support_winok_out.phpt index d9bde717d51e9..3d09816cde558 100644 --- a/tests/output/vt100_support_winok_out.phpt +++ b/tests/output/vt100_support_winok_out.phpt @@ -15,7 +15,7 @@ if (stripos(PHP_OS, 'WIN') !== 0) { STDOUT --FILE-- --EXPECTF-- From 5d2ecf9979a997c8bb1a62b346e7b07ba38798e3 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sat, 8 Oct 2016 21:24:18 +0200 Subject: [PATCH 29/40] Enable ENABLE_VIRTUAL_TERMINAL_PROCESSING on Windows by default --- sapi/cli/php_cli.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index dc92045ae7402..dd1db97b42b73 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -38,6 +38,7 @@ #ifdef PHP_WIN32 #include "win32/time.h" #include "win32/signal.h" +#include "win32/console.h" #include #include #endif @@ -243,6 +244,9 @@ static void print_extensions(void) /* {{{ */ #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif static inline int sapi_cli_select(int fd) { @@ -1208,6 +1212,11 @@ int main(int argc, char *argv[]) */ argv = save_ps_args(argc, argv); +#ifdef PHP_WIN32 + php_win32_console_fileno_set_vt100(STDOUT_FILENO, TRUE); + php_win32_console_fileno_set_vt100(STDERR_FILENO, TRUE); +#endif + cli_sapi_module.additional_functions = additional_functions; #if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) From 7581767d49100ba410ffe8b50244a5f1696f44bc Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 9 Oct 2016 18:11:46 +0200 Subject: [PATCH 30/40] Remove tests for stream_vt100_support --- tests/output/vt100_support.inc | 65 -------- tests/output/vt100_support_posix_err.phpt | 140 ----------------- tests/output/vt100_support_posix_in-err.phpt | 140 ----------------- .../vt100_support_posix_in-out-err.phpt | 140 ----------------- tests/output/vt100_support_posix_in-out.phpt | 140 ----------------- tests/output/vt100_support_posix_out-err.phpt | 140 ----------------- tests/output/vt100_support_posix_out.phpt | 140 ----------------- tests/output/vt100_support_winko_err.phpt | 145 ------------------ tests/output/vt100_support_winko_in-err.phpt | 145 ------------------ .../vt100_support_winko_in-out-err.phpt | 145 ------------------ tests/output/vt100_support_winko_in-out.phpt | 145 ------------------ tests/output/vt100_support_winko_out-err.phpt | 145 ------------------ tests/output/vt100_support_winko_out.phpt | 145 ------------------ tests/output/vt100_support_winok_err.phpt | 145 ------------------ tests/output/vt100_support_winok_in-err.phpt | 145 ------------------ .../vt100_support_winok_in-out-err.phpt | 145 ------------------ tests/output/vt100_support_winok_in-out.phpt | 145 ------------------ tests/output/vt100_support_winok_out-err.phpt | 145 ------------------ tests/output/vt100_support_winok_out.phpt | 145 ------------------ 19 files changed, 2645 deletions(-) delete mode 100644 tests/output/vt100_support.inc delete mode 100644 tests/output/vt100_support_posix_err.phpt delete mode 100644 tests/output/vt100_support_posix_in-err.phpt delete mode 100644 tests/output/vt100_support_posix_in-out-err.phpt delete mode 100644 tests/output/vt100_support_posix_in-out.phpt delete mode 100644 tests/output/vt100_support_posix_out-err.phpt delete mode 100644 tests/output/vt100_support_posix_out.phpt delete mode 100644 tests/output/vt100_support_winko_err.phpt delete mode 100644 tests/output/vt100_support_winko_in-err.phpt delete mode 100644 tests/output/vt100_support_winko_in-out-err.phpt delete mode 100644 tests/output/vt100_support_winko_in-out.phpt delete mode 100644 tests/output/vt100_support_winko_out-err.phpt delete mode 100644 tests/output/vt100_support_winko_out.phpt delete mode 100644 tests/output/vt100_support_winok_err.phpt delete mode 100644 tests/output/vt100_support_winok_in-err.phpt delete mode 100644 tests/output/vt100_support_winok_in-out-err.phpt delete mode 100644 tests/output/vt100_support_winok_in-out.phpt delete mode 100644 tests/output/vt100_support_winok_out-err.phpt delete mode 100644 tests/output/vt100_support_winok_out.phpt diff --git a/tests/output/vt100_support.inc b/tests/output/vt100_support.inc deleted file mode 100644 index 723edf28b63be..0000000000000 --- a/tests/output/vt100_support.inc +++ /dev/null @@ -1,65 +0,0 @@ - STDIN, - 'STDIN (fopen)' => fopen('php://stdin', 'rb'), - 'STDIN (php://fd/0)' => fopen('php://fd/0', 'rb'), - 'STDOUT (constant)' => STDOUT, - 'STDOUT (fopen)' => fopen('php://stdout', 'wb'), - 'STDOUT (php://fd/1)' => fopen('php://fd/1', 'wb'), - 'STDERR (constant)' => STDERR, - 'STDERR (fopen)' => fopen('php://stderr', 'wb'), - 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), - 'Not a stream' => 'foo', - 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), - 'Invalid stream (php://input)' => fopen('php://input', 'wb'), - 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), - 'File stream' => $closeMe = fopen(__FILE__, 'rb'), - ); - - foreach ($sampleStreams as $name => $stream) { - echo "$name:\n"; - echo "- current value : "; var_dump(stream_vt100_support($stream)); - echo "- enabling VT100 : "; var_dump(stream_vt100_support($stream, true)); - echo "- current value : "; var_dump(stream_vt100_support($stream)); - echo "- disabling VT100: "; var_dump(stream_vt100_support($stream, false)); - echo "- current value : "; var_dump(stream_vt100_support($stream)); - } - - fclose($closeMe); - restoreVT100State($state); -} - -function testVT100ToStdErr() -{ - ob_start(); - testVT100ToStdOut(); - $result = ob_get_contents(); - ob_end_clean(); - fwrite(STDERR, $result); -} diff --git a/tests/output/vt100_support_posix_err.phpt b/tests/output/vt100_support_posix_err.phpt deleted file mode 100644 index 07d08a5c3ef55..0000000000000 --- a/tests/output/vt100_support_posix_err.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDERR ---SKIPIF-- - ---CAPTURE_STDIO-- -STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (php://fd/0): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (php://fd/1): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-err.phpt b/tests/output/vt100_support_posix_in-err.phpt deleted file mode 100644 index fdeb4885150b7..0000000000000 --- a/tests/output/vt100_support_posix_in-err.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDIN/STDERR ---SKIPIF-- - ---CAPTURE_STDIO-- -STDIN STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (php://fd/1): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-out-err.phpt b/tests/output/vt100_support_posix_in-out-err.phpt deleted file mode 100644 index fc2ad85852d74..0000000000000 --- a/tests/output/vt100_support_posix_in-out-err.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDIN/STDOUT/STDERR ---SKIPIF-- - ---CAPTURE_STDIO-- -STDIN STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_posix_in-out.phpt b/tests/output/vt100_support_posix_in-out.phpt deleted file mode 100644 index 65efc63878758..0000000000000 --- a/tests/output/vt100_support_posix_in-out.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDIN/STDOUT ---SKIPIF-- - ---CAPTURE_STDIO-- -STDIN STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (php://fd/2): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_posix_out-err.phpt b/tests/output/vt100_support_posix_out-err.phpt deleted file mode 100644 index 4b2ef5b15319e..0000000000000 --- a/tests/output/vt100_support_posix_out-err.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDOUT/STDERR ---SKIPIF-- - ---CAPTURE_STDIO-- -STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (php://fd/0): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_posix_out.phpt b/tests/output/vt100_support_posix_out.phpt deleted file mode 100644 index 2824101157d49..0000000000000 --- a/tests/output/vt100_support_posix_out.phpt +++ /dev/null @@ -1,140 +0,0 @@ ---TEST-- -Test stream_vt100_support on POSIX with redirected STDOUT ---SKIPIF-- - ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDIN (php://fd/0): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (fopen): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -STDERR (php://fd/2): -- current value : bool(true) -- enabling VT100 : bool(false) -- current value : bool(true) -- disabling VT100: bool(false) -- current value : bool(true) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_err.phpt b/tests/output/vt100_support_winko_err.phpt deleted file mode 100644 index 468265b152e7c..0000000000000 --- a/tests/output/vt100_support_winko_err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDERR ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-err.phpt b/tests/output/vt100_support_winko_in-err.phpt deleted file mode 100644 index 302807fa0108e..0000000000000 --- a/tests/output/vt100_support_winko_in-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDIN/STDERR ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-out-err.phpt b/tests/output/vt100_support_winko_in-out-err.phpt deleted file mode 100644 index ca01445ff68a6..0000000000000 --- a/tests/output/vt100_support_winko_in-out-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDIN/STDOUT/STDERR ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_in-out.phpt b/tests/output/vt100_support_winko_in-out.phpt deleted file mode 100644 index b5cf8f3a71e5e..0000000000000 --- a/tests/output/vt100_support_winko_in-out.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDIN/STDOUT ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_out-err.phpt b/tests/output/vt100_support_winko_out-err.phpt deleted file mode 100644 index 15344d88e4a1f..0000000000000 --- a/tests/output/vt100_support_winko_out-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDOUT/STDERR ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winko_out.phpt b/tests/output/vt100_support_winko_out.phpt deleted file mode 100644 index 073d98ce0fc2a..0000000000000 --- a/tests/output/vt100_support_winko_out.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on older Windows versions with redirected STDOUT ---SKIPIF-- -= 0) { - echo "skip Only for Windows systems < 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(true) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_err.phpt b/tests/output/vt100_support_winok_err.phpt deleted file mode 100644 index 3e2950950c78f..0000000000000 --- a/tests/output/vt100_support_winok_err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDERR ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-err.phpt b/tests/output/vt100_support_winok_in-err.phpt deleted file mode 100644 index 06e91d03c344b..0000000000000 --- a/tests/output/vt100_support_winok_in-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDIN/STDERR ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-out-err.phpt b/tests/output/vt100_support_winok_in-out-err.phpt deleted file mode 100644 index 10f35d396a6ed..0000000000000 --- a/tests/output/vt100_support_winok_in-out-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDIN/STDOUT/STDERR ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_in-out.phpt b/tests/output/vt100_support_winok_in-out.phpt deleted file mode 100644 index 086f7c0753446..0000000000000 --- a/tests/output/vt100_support_winok_in-out.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDIN/STDOUT ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDIN STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_out-err.phpt b/tests/output/vt100_support_winok_out-err.phpt deleted file mode 100644 index 35252f81a6930..0000000000000 --- a/tests/output/vt100_support_winok_out-err.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDOUT/STDERR ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT STDERR ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) diff --git a/tests/output/vt100_support_winok_out.phpt b/tests/output/vt100_support_winok_out.phpt deleted file mode 100644 index 3d09816cde558..0000000000000 --- a/tests/output/vt100_support_winok_out.phpt +++ /dev/null @@ -1,145 +0,0 @@ ---TEST-- -Test stream_vt100_support on newer Windows versions with redirected STDOUT ---SKIPIF-- -= 10.0.10586"; -} -?> ---CAPTURE_STDIO-- -STDOUT ---FILE-- - ---EXPECTF-- -STDIN (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDIN (php://fd/0): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (constant): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (fopen): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDOUT (php://fd/1): -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) -STDERR (constant): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (fopen): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -STDERR (php://fd/2): -- current value : bool(false) -- enabling VT100 : bool(true) -- current value : bool(true) -- disabling VT100: bool(true) -- current value : bool(false) -Not a stream: -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() expects parameter 1 to be resource, string given in %s on line %d -bool(false) -Invalid stream (php://temp): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://input): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -Invalid stream (php://memory): -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- enabling VT100 : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- disabling VT100: -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -- current value : -Warning: stream_vt100_support() was not able to analyze the specified stream in %s on line %d -bool(false) -File stream: -- current value : bool(false) -- enabling VT100 : bool(false) -- current value : bool(false) -- disabling VT100: bool(false) -- current value : bool(false) From d15063c9e2bcc3d9c1dafe01d248e247900fbb82 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 9 Oct 2016 18:12:19 +0200 Subject: [PATCH 31/40] Split stream_vt100_support into stream_isatty+sapi_windows_vt100_support --- ext/standard/basic_functions.c | 13 ++++- ext/standard/streamsfuncs.c | 88 +++++++++++++++++++++++----------- ext/standard/streamsfuncs.h | 5 +- 3 files changed, 74 insertions(+), 32 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0564301979e69..f9bc4c9ccf016 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2011,10 +2011,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_supports_lock, 0, 0, 1) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_vt100_support, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_isatty, 0, 0, 1) + ZEND_ARG_INFO(0, stream) +ZEND_END_ARG_INFO() + +#ifdef PHP_WIN32 +ZEND_BEGIN_ARG_INFO_EX(arginfo_sapi_windows_vt100_support, 0, 0, 1) ZEND_ARG_INFO(0, stream) ZEND_ARG_INFO(0, enable) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_stream_select, 0, 0, 4) ZEND_ARG_INFO(1, read_streams) /* ARRAY_INFO(1, read_streams, 1) */ @@ -3139,7 +3145,10 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(stream_copy_to_stream, arginfo_stream_copy_to_stream) PHP_FE(stream_get_contents, arginfo_stream_get_contents) PHP_FE(stream_supports_lock, arginfo_stream_supports_lock) - PHP_FE(stream_vt100_support, arginfo_stream_vt100_support) + PHP_FE(stream_isatty, arginfo_stream_isatty) +#ifdef PHP_WIN32 + PHP_FE(sapi_windows_vt100_support, arginfo_sapi_windows_vt100_support) +#endif PHP_FE(fgetcsv, arginfo_fgetcsv) PHP_FE(fputcsv, arginfo_fputcsv) PHP_FE(flock, arginfo_flock) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 7e1f9ac147503..9de56cee9f517 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1636,10 +1636,60 @@ PHP_FUNCTION(stream_supports_lock) RETURN_TRUE; } -/* {{{ proto proto stream_vt100_support(resource stream[, bool enable]) - Get or set VT100 support for the specified stream. +/* {{{ proto proto stream_isatty(resource stream) +Check if a stream is a TTY. */ -PHP_FUNCTION(stream_vt100_support) +PHP_FUNCTION(stream_isatty) +{ + zval *zsrc; + php_stream *stream; + zend_long fileno; + + int argc = ZEND_NUM_ARGS(); + + if (zend_parse_parameters(argc, "r", &zsrc) == FAILURE) { + RETURN_FALSE; + } + + php_stream_from_zval(stream, zsrc); + + if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT, (void*)&fileno, 0); + } + else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS) { + php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fileno, 0); + } + else { + RETURN_FALSE; + } + +#ifdef PHP_WIN32 + /* Check if the Windows standard handle is redirected to file */ + if (php_win32_console_fileno_is_console(fileno)) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } +#elif HAVE_POSIX + /* Check if the file descriptor identifier is a terminal */ + if (isatty(fileno)) { + RETURN_TRUE; + } + else { + RETURN_FALSE; + } +#else + RETURN_FALSE; +#endif +} + +#ifdef PHP_WIN32 +/* {{{ proto proto sapi_windows_vt100_support(resource stream[, bool enable]) + Get or set VT100 support for the specified stream associated to an + output buffer of a Windows console. +*/ +PHP_FUNCTION(sapi_windows_vt100_support) { zval *zsrc; php_stream *stream; @@ -1669,13 +1719,12 @@ PHP_FUNCTION(stream_vt100_support) RETURN_FALSE; } + /* Check if the Windows standard handle is redirected to file */ + if (!php_win32_console_fileno_is_console(fileno)) { + RETURN_FALSE; + } + if (argc == 1) { - /* Check if the specified stream supports VT100 control codes */ -#ifdef PHP_WIN32 - /* Check if the Windows standard handle is redirected to file */ - if (!php_win32_console_fileno_is_console(fileno)) { - RETURN_FALSE; - } /* Check if the Windows standard handle has VT100 control codes enabled */ if (php_win32_console_fileno_has_vt100(fileno)) { RETURN_TRUE; @@ -1683,25 +1732,8 @@ PHP_FUNCTION(stream_vt100_support) else { RETURN_FALSE; } -#elif HAVE_POSIX - /* Check if the file descriptor identifier is a terminal */ - if (isatty(fileno)) { - RETURN_TRUE; - } - else { - RETURN_FALSE; - } -#else - RETURN_FALSE; -#endif } else { - /* Enable/disable VT100 control codes support for the specified stream */ -#ifdef PHP_WIN32 - /* Check if the Windows standard handle is redirected to file */ - if (!php_win32_console_fileno_is_console(fileno)) { - RETURN_FALSE; - } /* Enable/disable VT100 control codes support for the specified Windows standard handle */ if (php_win32_console_fileno_set_vt100(fileno, enable ? TRUE : FALSE)) { RETURN_TRUE; @@ -1709,11 +1741,9 @@ PHP_FUNCTION(stream_vt100_support) else { RETURN_FALSE; } -#else - RETURN_FALSE; -#endif } } +#endif #ifdef HAVE_SHUTDOWN /* {{{ proto int stream_socket_shutdown(resource stream, int how) diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index ab169a3439337..994d4fe1f81a1 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -61,7 +61,10 @@ PHP_FUNCTION(stream_socket_shutdown); PHP_FUNCTION(stream_resolve_include_path); PHP_FUNCTION(stream_is_local); PHP_FUNCTION(stream_supports_lock); -PHP_FUNCTION(stream_vt100_support); +PHP_FUNCTION(stream_isatty); +#ifdef PHP_WIN32 +PHP_FUNCTION(sapi_windows_vt100_support); +#endif #if HAVE_SOCKETPAIR PHP_FUNCTION(stream_socket_pair); From 65ad7796d824c2ea26316681867b157f6a9e597d Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 9 Oct 2016 18:12:53 +0200 Subject: [PATCH 32/40] Add tests for stream_isatty --- tests/output/stream_isatty.inc | 36 ++++++++++++++++++++++ tests/output/stream_isatty_err.phpt | 26 ++++++++++++++++ tests/output/stream_isatty_in-err.phpt | 26 ++++++++++++++++ tests/output/stream_isatty_in-out-err.phpt | 26 ++++++++++++++++ tests/output/stream_isatty_in-out.phpt | 26 ++++++++++++++++ tests/output/stream_isatty_out-err.phpt | 26 ++++++++++++++++ tests/output/stream_isatty_out.phpt | 26 ++++++++++++++++ 7 files changed, 192 insertions(+) create mode 100644 tests/output/stream_isatty.inc create mode 100644 tests/output/stream_isatty_err.phpt create mode 100644 tests/output/stream_isatty_in-err.phpt create mode 100644 tests/output/stream_isatty_in-out-err.phpt create mode 100644 tests/output/stream_isatty_in-out.phpt create mode 100644 tests/output/stream_isatty_out-err.phpt create mode 100644 tests/output/stream_isatty_out.phpt diff --git a/tests/output/stream_isatty.inc b/tests/output/stream_isatty.inc new file mode 100644 index 0000000000000..4b7f39986f4af --- /dev/null +++ b/tests/output/stream_isatty.inc @@ -0,0 +1,36 @@ + STDIN, + 'STDIN (fopen)' => fopen('php://stdin', 'rb'), + 'STDIN (php://fd/0)' => fopen('php://fd/0', 'rb'), + 'STDOUT (constant)' => STDOUT, + 'STDOUT (fopen)' => fopen('php://stdout', 'wb'), + 'STDOUT (php://fd/1)' => fopen('php://fd/1', 'wb'), + 'STDERR (constant)' => STDERR, + 'STDERR (fopen)' => fopen('php://stderr', 'wb'), + 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), + 'Not a stream' => 'foo', + 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), + 'Invalid stream (php://input)' => fopen('php://input', 'wb'), + 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), + 'File stream' => $closeMe = fopen(__FILE__, 'rb'), + ); + + foreach ($sampleStreams as $name => $stream) { + echo "$name: "; var_dump(stream_isatty($stream)); + } + + fclose($closeMe); +} + +function testToStdErr() +{ + ob_start(); + testToStdOut(); + $result = ob_get_contents(); + ob_end_clean(); + fwrite(STDERR, $result); +} diff --git a/tests/output/stream_isatty_err.phpt b/tests/output/stream_isatty_err.phpt new file mode 100644 index 0000000000000..65a45642cfe61 --- /dev/null +++ b/tests/output/stream_isatty_err.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDERR +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(true) +STDIN (fopen): bool(true) +STDIN (php://fd/0): bool(true) +STDOUT (constant): bool(true) +STDOUT (fopen): bool(true) +STDOUT (php://fd/1): bool(true) +STDERR (constant): bool(false) +STDERR (fopen): bool(false) +STDERR (php://fd/2): bool(false) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) diff --git a/tests/output/stream_isatty_in-err.phpt b/tests/output/stream_isatty_in-err.phpt new file mode 100644 index 0000000000000..b93ea03640a3c --- /dev/null +++ b/tests/output/stream_isatty_in-err.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDIN/STDERR +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(false) +STDIN (fopen): bool(false) +STDIN (php://fd/0): bool(false) +STDOUT (constant): bool(true) +STDOUT (fopen): bool(true) +STDOUT (php://fd/1): bool(true) +STDERR (constant): bool(false) +STDERR (fopen): bool(false) +STDERR (php://fd/2): bool(false) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) diff --git a/tests/output/stream_isatty_in-out-err.phpt b/tests/output/stream_isatty_in-out-err.phpt new file mode 100644 index 0000000000000..733d024b7e713 --- /dev/null +++ b/tests/output/stream_isatty_in-out-err.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDIN/STDOUT/STDERR +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(false) +STDIN (fopen): bool(false) +STDIN (php://fd/0): bool(false) +STDOUT (constant): bool(false) +STDOUT (fopen): bool(false) +STDOUT (php://fd/1): bool(false) +STDERR (constant): bool(false) +STDERR (fopen): bool(false) +STDERR (php://fd/2): bool(false) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) diff --git a/tests/output/stream_isatty_in-out.phpt b/tests/output/stream_isatty_in-out.phpt new file mode 100644 index 0000000000000..755ee82d18832 --- /dev/null +++ b/tests/output/stream_isatty_in-out.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDIN/STDOUT +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(false) +STDIN (fopen): bool(false) +STDIN (php://fd/0): bool(false) +STDOUT (constant): bool(false) +STDOUT (fopen): bool(false) +STDOUT (php://fd/1): bool(false) +STDERR (constant): bool(true) +STDERR (fopen): bool(true) +STDERR (php://fd/2): bool(true) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) diff --git a/tests/output/stream_isatty_out-err.phpt b/tests/output/stream_isatty_out-err.phpt new file mode 100644 index 0000000000000..97d804601b5a7 --- /dev/null +++ b/tests/output/stream_isatty_out-err.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDOUT/STDERR +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(true) +STDIN (fopen): bool(true) +STDIN (php://fd/0): bool(true) +STDOUT (constant): bool(false) +STDOUT (fopen): bool(false) +STDOUT (php://fd/1): bool(false) +STDERR (constant): bool(false) +STDERR (fopen): bool(false) +STDERR (php://fd/2): bool(false) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) diff --git a/tests/output/stream_isatty_out.phpt b/tests/output/stream_isatty_out.phpt new file mode 100644 index 0000000000000..ed592f12e13df --- /dev/null +++ b/tests/output/stream_isatty_out.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test stream_isatty with redirected STDOUT +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): bool(true) +STDIN (fopen): bool(true) +STDIN (php://fd/0): bool(true) +STDOUT (constant): bool(false) +STDOUT (fopen): bool(false) +STDOUT (php://fd/1): bool(false) +STDERR (constant): bool(true) +STDERR (fopen): bool(true) +STDERR (php://fd/2): bool(true) +Not a stream: +Warning: stream_isatty() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): bool(false) +Invalid stream (php://input): bool(false) +Invalid stream (php://memory): bool(false) +File stream: bool(false) From 67e1eb7dad182bb5ca43d5b5d2764c4b652df47b Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Sun, 9 Oct 2016 18:13:10 +0200 Subject: [PATCH 33/40] Add tests for sapi_windows_vt100_support --- tests/output/sapi_windows_vt100_support.inc | 65 ++++++++ ...sapi_windows_vt100_support_notwindows.phpt | 14 ++ .../sapi_windows_vt100_support_winko_err.phpt | 145 ++++++++++++++++++ ...pi_windows_vt100_support_winko_in-err.phpt | 145 ++++++++++++++++++ ...indows_vt100_support_winko_in-out-err.phpt | 145 ++++++++++++++++++ ...pi_windows_vt100_support_winko_in-out.phpt | 145 ++++++++++++++++++ ...i_windows_vt100_support_winko_out-err.phpt | 145 ++++++++++++++++++ .../sapi_windows_vt100_support_winko_out.phpt | 145 ++++++++++++++++++ .../sapi_windows_vt100_support_winok_err.phpt | 145 ++++++++++++++++++ ...pi_windows_vt100_support_winok_in-err.phpt | 145 ++++++++++++++++++ ...indows_vt100_support_winok_in-out-err.phpt | 145 ++++++++++++++++++ ...pi_windows_vt100_support_winok_in-out.phpt | 145 ++++++++++++++++++ ...i_windows_vt100_support_winok_out-err.phpt | 145 ++++++++++++++++++ .../sapi_windows_vt100_support_winok_out.phpt | 145 ++++++++++++++++++ 14 files changed, 1819 insertions(+) create mode 100644 tests/output/sapi_windows_vt100_support.inc create mode 100644 tests/output/sapi_windows_vt100_support_notwindows.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_in-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_in-out.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_out-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winko_out.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_in-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_in-out.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_out-err.phpt create mode 100644 tests/output/sapi_windows_vt100_support_winok_out.phpt diff --git a/tests/output/sapi_windows_vt100_support.inc b/tests/output/sapi_windows_vt100_support.inc new file mode 100644 index 0000000000000..9ac54cea61510 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support.inc @@ -0,0 +1,65 @@ + STDIN, + 'STDIN (fopen)' => fopen('php://stdin', 'rb'), + 'STDIN (php://fd/0)' => fopen('php://fd/0', 'rb'), + 'STDOUT (constant)' => STDOUT, + 'STDOUT (fopen)' => fopen('php://stdout', 'wb'), + 'STDOUT (php://fd/1)' => fopen('php://fd/1', 'wb'), + 'STDERR (constant)' => STDERR, + 'STDERR (fopen)' => fopen('php://stderr', 'wb'), + 'STDERR (php://fd/2)' => fopen('php://fd/2', 'wb'), + 'Not a stream' => 'foo', + 'Invalid stream (php://temp)' => fopen('php://temp', 'wb'), + 'Invalid stream (php://input)' => fopen('php://input', 'wb'), + 'Invalid stream (php://memory)' => fopen('php://memory', 'wb'), + 'File stream' => $closeMe = fopen(__FILE__, 'rb'), + ); + + foreach ($sampleStreams as $name => $stream) { + echo "$name:\n"; + echo "- current value : "; var_dump(sapi_windows_vt100_support($stream)); + echo "- enabling VT100 : "; var_dump(sapi_windows_vt100_support($stream, true)); + echo "- current value : "; var_dump(sapi_windows_vt100_support($stream)); + echo "- disabling VT100: "; var_dump(sapi_windows_vt100_support($stream, false)); + echo "- current value : "; var_dump(sapi_windows_vt100_support($stream)); + } + + fclose($closeMe); + restoreVT100State($state); +} + +function testToStdErr() +{ + ob_start(); + testToStdOut(); + $result = ob_get_contents(); + ob_end_clean(); + fwrite(STDERR, $result); +} diff --git a/tests/output/sapi_windows_vt100_support_notwindows.phpt b/tests/output/sapi_windows_vt100_support_notwindows.phpt new file mode 100644 index 0000000000000..5ff382350a513 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_notwindows.phpt @@ -0,0 +1,14 @@ +--TEST-- +Test that sapi_windows_vt100_support exists only on Windows +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_err.phpt b/tests/output/sapi_windows_vt100_support_winko_err.phpt new file mode 100644 index 0000000000000..c722e549be2fe --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt new file mode 100644 index 0000000000000..0e8097eef6948 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt new file mode 100644 index 0000000000000..496f467df3e70 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/STDOUT/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt new file mode 100644 index 0000000000000..da9a2378fec79 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/STDOUT +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt new file mode 100644 index 0000000000000..94604bad0ef6d --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT/STDERR +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winko_out.phpt b/tests/output/sapi_windows_vt100_support_winko_out.phpt new file mode 100644 index 0000000000000..563a3282cc589 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winko_out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT +--SKIPIF-- += 0) { + echo "skip Only for Windows systems < 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_err.phpt b/tests/output/sapi_windows_vt100_support_winok_err.phpt new file mode 100644 index 0000000000000..58b3f6b35d9bd --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt new file mode 100644 index 0000000000000..4eda2c45340b4 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt new file mode 100644 index 0000000000000..62ed43c6a8636 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/STDOUT/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt new file mode 100644 index 0000000000000..d146c5dc5cefc --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/STDOUT +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDIN STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt new file mode 100644 index 0000000000000..223b0ddf3bf36 --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT/STDERR +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT STDERR +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) diff --git a/tests/output/sapi_windows_vt100_support_winok_out.phpt b/tests/output/sapi_windows_vt100_support_winok_out.phpt new file mode 100644 index 0000000000000..69cb508701fdf --- /dev/null +++ b/tests/output/sapi_windows_vt100_support_winok_out.phpt @@ -0,0 +1,145 @@ +--TEST-- +Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT +--SKIPIF-- += 10.0.10586"; +} +?> +--CAPTURE_STDIO-- +STDOUT +--FILE-- + +--EXPECTF-- +STDIN (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDIN (php://fd/0): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (constant): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (fopen): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDOUT (php://fd/1): +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) +STDERR (constant): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (fopen): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +STDERR (php://fd/2): +- current value : bool(false) +- enabling VT100 : bool(true) +- current value : bool(true) +- disabling VT100: bool(true) +- current value : bool(false) +Not a stream: +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() expects parameter 1 to be resource, string given in %s on line %d +bool(false) +Invalid stream (php://temp): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://input): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +Invalid stream (php://memory): +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- enabling VT100 : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- disabling VT100: +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +- current value : +Warning: sapi_windows_vt100_support() was not able to analyze the specified stream in %s on line %d +bool(false) +File stream: +- current value : bool(false) +- enabling VT100 : bool(false) +- current value : bool(false) +- disabling VT100: bool(false) +- current value : bool(false) From f9ff470b8c82fdcdbbae1de1356f7002c02f5016 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 14 Oct 2016 14:21:37 +0200 Subject: [PATCH 34/40] Return null from stream_isatty is neither Windows nor Posix --- ext/standard/streamsfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 9de56cee9f517..abec77886e554 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1680,7 +1680,7 @@ PHP_FUNCTION(stream_isatty) RETURN_FALSE; } #else - RETURN_FALSE; + RETURN_NULL(); #endif } From 6df8c3c934e18ab57d30d0b1a6297d092e5ad9ba Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 14 Oct 2016 14:42:26 +0200 Subject: [PATCH 35/40] Fallback to S_ISCHR if neither Windows nor Posix --- ext/standard/streamsfuncs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index abec77886e554..268af16ad4e29 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1680,6 +1680,12 @@ PHP_FUNCTION(stream_isatty) RETURN_FALSE; } #else + zend_stat_t stat; + if (zend_fstat(fileno, &stat) == 0) { + if ((stat.st_mode & /*S_IFMT*/0170000) == /*S_IFCHR*/0020000) { + RETURN_TRUE; + } + } RETURN_NULL(); #endif } From 1081aa898fcca143f596aac4141ae0d306fc3837 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 17 Oct 2016 09:09:32 +0200 Subject: [PATCH 36/40] Avoid defining argc since it's only used once --- ext/standard/streamsfuncs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 268af16ad4e29..2f0ecb2f53986 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1645,9 +1645,7 @@ PHP_FUNCTION(stream_isatty) php_stream *stream; zend_long fileno; - int argc = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(argc, "r", &zsrc) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zsrc) == FAILURE) { RETURN_FALSE; } From e4aaa275295c65e23c5eb5170ec8341e75c7777a Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 17 Oct 2016 09:10:37 +0200 Subject: [PATCH 37/40] Better comment about php_win32_console_fileno_is_console --- ext/standard/streamsfuncs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 2f0ecb2f53986..e70f124cf117c 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -1723,7 +1723,7 @@ PHP_FUNCTION(sapi_windows_vt100_support) RETURN_FALSE; } - /* Check if the Windows standard handle is redirected to file */ + /* Check if the file descriptor is a console */ if (!php_win32_console_fileno_is_console(fileno)) { RETURN_FALSE; } From 2d062f333bd7d6b61adbd5a78ee760429c748b85 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 17 Oct 2016 09:11:40 +0200 Subject: [PATCH 38/40] Use events instead of cNumberOfEvents --- win32/console.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/win32/console.c b/win32/console.c index 91407368beedc..7c962c06f6121 100644 --- a/win32/console.c +++ b/win32/console.c @@ -41,9 +41,9 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_has_vt100(zend_long fileno) HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { - DWORD cNumberOfEvents; + DWORD events; - if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &events)) { // Not STDIN DWORD mode; @@ -63,9 +63,9 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e HANDLE handle = (HANDLE) _get_osfhandle(fileno); if (handle != INVALID_HANDLE_VALUE) { - DWORD cNumberOfEvents; + DWORD events; - if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &cNumberOfEvents)) { + if (fileno != 0 && !GetNumberOfConsoleInputEvents(handle, &events)) { // Not STDIN DWORD mode; From d70a7f288d6c144c4cf4c1b340272ab254ec9560 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 17 Oct 2016 09:13:12 +0200 Subject: [PATCH 39/40] Do not restore previous console mode We need to restore previous console mode on failing SetConsole calls only for STDIN --- win32/console.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/win32/console.c b/win32/console.c index 7c962c06f6121..a133e0e085981 100644 --- a/win32/console.c +++ b/win32/console.c @@ -85,11 +85,6 @@ PHP_WINUTIL_API BOOL php_win32_console_fileno_set_vt100(zend_long fileno, BOOL e if (SetConsoleMode(handle, newMode)) { result = TRUE; } - else { - // SetConsoleMode sets the flags even if it fails, so let's revert them back - // (otherwise subsequent calls to GetConsoleMode will receive the new (invalid) flags - SetConsoleMode(handle, mode); - } } } } From d1772e6c16d92c05048b53ac50ee97dfb77f3c9f Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 17 Oct 2016 17:16:49 +0200 Subject: [PATCH 40/40] Don't configure STDOUT/STDERR on Windows with PHP_CLI_WIN32_NO_CONSOLE --- sapi/cli/php_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index dd1db97b42b73..56ab3fec6db4d 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1212,7 +1212,7 @@ int main(int argc, char *argv[]) */ argv = save_ps_args(argc, argv); -#ifdef PHP_WIN32 +#if defined(PHP_WIN32) && !defined(PHP_CLI_WIN32_NO_CONSOLE) php_win32_console_fileno_set_vt100(STDOUT_FILENO, TRUE); php_win32_console_fileno_set_vt100(STDERR_FILENO, TRUE); #endif