summaryrefslogtreecommitdiff
path: root/main/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/main.c')
-rw-r--r--main/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/main/main.c b/main/main.c
index 2d0aee4991..2d650e803b 100644
--- a/main/main.c
+++ b/main/main.c
@@ -887,6 +887,7 @@ int php_module_startup(sapi_module_struct *sf)
zend_utility_functions zuf;
zend_utility_values zuv;
int module_number=0; /* for REGISTER_INI_ENTRIES() */
+ char *php_os;
#ifdef ZTS
zend_executor_globals *executor_globals;
php_core_globals *core_globals;
@@ -896,6 +897,16 @@ int php_module_startup(sapi_module_struct *sf)
WORD wVersionRequested = MAKEWORD(2, 0);
WSADATA wsaData;
#endif
+#if WIN32|WINNT
+ /* Get build numbers for Windows NT or Win95 */
+ if (dwVersion < 0x80000000){
+ php_os="WINNT";
+ } else {
+ php_os="WIN32";
+ }
+#else
+ php_os=PHP_OS;
+#endif
global_lock_init();
SG(server_context) = NULL;
@@ -963,6 +974,9 @@ int php_module_startup(sapi_module_struct *sf)
zend_set_utility_values(&zuv);
php_startup_SAPI_content_types();
+ REGISTER_MAIN_STRINGL_CONSTANT("PHP_VERSION", PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS);
+ REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS);
+
if (php_startup_internal_extensions() == FAILURE) {
php_printf("Unable to start builtin modules\n");
return FAILURE;