diff --git a/main/main.c b/main/main.c index 07144af906c..4e331ac2c8c 100644 --- a/main/main.c +++ b/main/main.c @@ -2053,14 +2053,13 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod zend_utility_functions zuf; zend_utility_values zuv; int retval = SUCCESS, module_number=0; /* for REGISTER_INI_ENTRIES() */ - char *php_os, *php_os_family; + char *php_os; zend_module_entry *module; #ifdef PHP_WIN32 WORD wVersionRequested = MAKEWORD(2, 0); WSADATA wsaData; -#endif -#ifdef PHP_WIN32 + php_os = "WINNT"; old_invalid_parameter_handler = @@ -2075,21 +2074,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod php_os = PHP_OS; #endif -#if defined(PHP_WIN32) - php_os_family = "WIN"; -#elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - php_os_family = "BSD"; -#elif defined(__APPLE__) || defined(__MACH__) - php_os_family = "OSX"; -#elif defined(__sun__) - php_os_family = "SOLARIS"; -#elif defined(__linux__) - php_os_family = "LINUX"; -#else - php_os_family = "unknown"; -#endif - - #ifdef ZTS (void)ts_resource(0); #endif @@ -2173,7 +2157,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod #endif REGISTER_MAIN_LONG_CONSTANT("PHP_DEBUG", PHP_DEBUG, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS_FAMILY", php_os_family, strlen(php_os_family), CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS_FAMILY", PHP_OS_FAMILY, sizeof(PHP_OS_FAMILY)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_SAPI", sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("DEFAULT_INCLUDE_PATH", PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PEAR_INSTALL_DIR", PEAR_INSTALLDIR, sizeof(PEAR_INSTALLDIR)-1, CONST_PERSISTENT | CONST_CS); diff --git a/main/php.h b/main/php.h index 23d365d9e3f..fcf7b8cef5a 100644 --- a/main/php.h +++ b/main/php.h @@ -41,6 +41,19 @@ #undef sprintf #define sprintf php_sprintf +/* Operating system family defintion */ +#ifdef PHP_WIN32 +# define PHP_OS_FAMILY "Windows" +#elif defined(BSD) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +# define PHP_OS_FAMILY "BSD" +#elif defined(__APPLE__) || defined(__MACH__) +# define PHP_OS_FAMILY "OSX" +#elif defined(__sun__) +# define PHP_OS_FAMILY "Solaris" +#elif defined(__linux__) +# define PHP_OS_FAMILY "Unknown" +#endif + /* PHP's DEBUG value must match Zend's ZEND_DEBUG value */ #undef PHP_DEBUG #define PHP_DEBUG ZEND_DEBUG diff --git a/tests/basic/req60524-win.phpt b/tests/basic/req60524-win.phpt index 8eb38a528c9..26fa9d9c5c7 100644 --- a/tests/basic/req60524-win.phpt +++ b/tests/basic/req60524-win.phpt @@ -4,7 +4,7 @@ Req #60524 (Specify temporary directory) sys_temp_dir=C:\Windows --SKIPIF-- --FILE-- diff --git a/tests/basic/req60524.phpt b/tests/basic/req60524.phpt index e4999e1a203..670940598ae 100644 --- a/tests/basic/req60524.phpt +++ b/tests/basic/req60524.phpt @@ -4,7 +4,7 @@ Req #60524 (Specify temporary directory) sys_temp_dir=/path/to/temp/dir --SKIPIF-- diff --git a/tests/output/sapi_windows_vt100_support_notwindows.phpt b/tests/output/sapi_windows_vt100_support_notwindows.phpt index d1afa4d9a3f..cf4bf6fa6c9 100644 --- a/tests/output/sapi_windows_vt100_support_notwindows.phpt +++ b/tests/output/sapi_windows_vt100_support_notwindows.phpt @@ -2,7 +2,7 @@ Test that sapi_windows_vt100_support exists only on Windows --SKIPIF-- diff --git a/tests/output/sapi_windows_vt100_support_winko_err.phpt b/tests/output/sapi_windows_vt100_support_winko_err.phpt index 9c85a207257..04dbef561e6 100644 --- a/tests/output/sapi_windows_vt100_support_winko_err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDERR if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt index 595b5c401f1..e83b51dff32 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, 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 index 44fae220ff7..fef672dda52 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt index 322e7ad2297..f8deab18e5d 100644 --- a/tests/output/sapi_windows_vt100_support_winko_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_in-out.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt index e61652c13fb..7d72d9217e0 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winko_out.phpt b/tests/output/sapi_windows_vt100_support_winko_out.phpt index 21966c8f648..d06a244e823 100644 --- a/tests/output/sapi_windows_vt100_support_winko_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winko_out.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on older Windows versions with redirected STDOUT if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winok_err.phpt b/tests/output/sapi_windows_vt100_support_winok_err.phpt index 26da5564b3f..b05f7de753a 100644 --- a/tests/output/sapi_windows_vt100_support_winok_err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDERR if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt index 646e169d9bf..9699d5fd3c6 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, 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 index d277128095b..09bf3d154bb 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt index 1dd889aa053..81b6696b445 100644 --- a/tests/output/sapi_windows_vt100_support_winok_in-out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_in-out.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDIN/ if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt index e31b6881790..2062007bf3c 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out-err.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out-err.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/output/sapi_windows_vt100_support_winok_out.phpt b/tests/output/sapi_windows_vt100_support_winok_out.phpt index 5379ac20599..cc1f83fdfd0 100644 --- a/tests/output/sapi_windows_vt100_support_winok_out.phpt +++ b/tests/output/sapi_windows_vt100_support_winok_out.phpt @@ -5,7 +5,7 @@ Test sapi_windows_vt100_support on newer Windows versions with redirected STDOUT if (getenv("SKIP_IO_CAPTURE_TESTS")) { die("skip I/O capture test"); } -if(PHP_OS_FAMILY !== "WIN") { +if(PHP_OS_FAMILY !== "Windows") { echo "skip Only for Windows systems"; } elseif (version_compare( PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD, diff --git a/tests/security/open_basedir_001.phpt b/tests/security/open_basedir_001.phpt index 7b198df8438..c4459686fbc 100644 --- a/tests/security/open_basedir_001.phpt +++ b/tests/security/open_basedir_001.phpt @@ -2,7 +2,7 @@ openbase_dir runtime tightning --SKIPIF-- diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt index 0f2b941e3ca..5a532f84559 100644 --- a/tests/security/open_basedir_linkinfo.phpt +++ b/tests/security/open_basedir_linkinfo.phpt @@ -2,7 +2,7 @@ Test open_basedir configuration --SKIPIF-- diff --git a/tests/security/open_basedir_mkdir.phpt b/tests/security/open_basedir_mkdir.phpt index fba0dfbc0a9..91cb3922068 100644 --- a/tests/security/open_basedir_mkdir.phpt +++ b/tests/security/open_basedir_mkdir.phpt @@ -2,7 +2,7 @@ Test open_basedir configuration --SKIPIF-- diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt index 5dec5f83a7e..31ad1e5982c 100644 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -4,7 +4,7 @@ Test open_basedir configuration open_basedir=. --SKIPIF-- diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt index 16c638a3074..a2d892909de 100644 --- a/tests/security/open_basedir_readlink.phpt +++ b/tests/security/open_basedir_readlink.phpt @@ -2,8 +2,8 @@ Test open_basedir configuration --SKIPIF-- --FILE-- diff --git a/tests/security/open_basedir_realpath.phpt b/tests/security/open_basedir_realpath.phpt index c44215aa47f..9f56cd8005d 100644 --- a/tests/security/open_basedir_realpath.phpt +++ b/tests/security/open_basedir_realpath.phpt @@ -2,7 +2,7 @@ Test open_basedir configuration --SKIPIF-- diff --git a/tests/security/open_basedir_symlink.phpt b/tests/security/open_basedir_symlink.phpt index fe138cf9566..ae431df2cad 100644 --- a/tests/security/open_basedir_symlink.phpt +++ b/tests/security/open_basedir_symlink.phpt @@ -2,8 +2,8 @@ Test open_basedir configuration --SKIPIF-- --INI--