mirror of
https://github.com/php/php-src.git
synced 2025-01-23 20:23:31 +08:00
Change PHP_OS_FAMILY slightly
* PHP_OS_FAMILY is now a macro, to allow extensions to take advantage of it, it is defined in php.h * Values are not upper-case-first, not always uppercase. Windows is no longer just "Win", if we want the short version for testing then PHP_OS is always WINNT anyway
This commit is contained in:
parent
dbdb0819b2
commit
f9959ee7c2
22
main/main.c
22
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);
|
||||
|
13
main/php.h
13
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
|
||||
|
@ -4,7 +4,7 @@ Req #60524 (Specify temporary directory)
|
||||
sys_temp_dir=C:\Windows
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY !== "WIN")
|
||||
if(PHP_OS_FAMILY !== "Windows")
|
||||
die('skip Run only on Windows');
|
||||
?>
|
||||
--FILE--
|
||||
|
@ -4,7 +4,7 @@ Req #60524 (Specify temporary directory)
|
||||
sys_temp_dir=/path/to/temp/dir
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip non-windows only test');
|
||||
}
|
||||
?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
Test that sapi_windows_vt100_support exists only on Windows
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
echo "skip Only for not Windows systems";
|
||||
}
|
||||
?>
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -2,7 +2,7 @@
|
||||
openbase_dir runtime tightning
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip.. only for unix');
|
||||
}
|
||||
if (!is_dir("/usr/local/bin")) {
|
||||
|
@ -2,7 +2,7 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip no links on Windows');
|
||||
}
|
||||
?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip no symlinks on Windows');
|
||||
}
|
||||
?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY !== "WIN") {
|
||||
if(PHP_OS_FAMILY !== "Windows") {
|
||||
die('skip Windows only variation');
|
||||
}
|
||||
?>
|
||||
|
@ -4,7 +4,7 @@ Test open_basedir configuration
|
||||
open_basedir=.
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY !== "WIN") {
|
||||
if(PHP_OS_FAMILY !== "Windows") {
|
||||
die('skip Windows only variation');
|
||||
}
|
||||
?>
|
||||
|
@ -2,8 +2,8 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
die('skip no symlinks on Windows');
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip not for Windows');
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
|
@ -2,7 +2,7 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY !== "WIN") {
|
||||
if(PHP_OS_FAMILY !== "Windows") {
|
||||
die('skip only run on Windows');
|
||||
}
|
||||
?>
|
||||
|
@ -2,8 +2,8 @@
|
||||
Test open_basedir configuration
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(PHP_OS_FAMILY === "WIN") {
|
||||
die('skip no symlinks on Windows');
|
||||
if(PHP_OS_FAMILY === "Windows") {
|
||||
die('skip not for Windows');
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
|
Loading…
Reference in New Issue
Block a user