diff options
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/info.c | 44 | ||||
-rw-r--r-- | ext/standard/info.h | 10 | ||||
-rw-r--r-- | sapi/isapi/PWS-php4.reg | 5 | ||||
-rw-r--r-- | sapi/isapi/php4isapi.c | 36 | ||||
-rw-r--r-- | tests/run.html | 11 | ||||
-rw-r--r-- | tests/run.php | 17 |
7 files changed, 104 insertions, 21 deletions
@@ -2,6 +2,8 @@ PHP 4.0 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ?? ????, Version 4.0 Beta 4 +- Made PHP work under Microsoft Personal Web Server, under both Windows NT + workstation and Windows 95 (Zeev) - Made multipart/form-data content obey to the variables_order directive (Zeev) - Updated the browscap module to work with PHP 4.0 (Zeev) - Recover gracefully in ISAPI after the client prematurely presses STOP (Andi) diff --git a/ext/standard/info.c b/ext/standard/info.c index f4058636d3..2110753d97 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -274,30 +274,49 @@ void php_print_credits(int flag) PUTS("<h1>PHP 4.0 Credits</h1>\n"); + if (flag & PHP_CREDITS_GROUP) { + /* Group */ + + PUTS("<table border=5 width=\"600\">\n"); + php_info_print_table_header(1, "PHP Group"); + php_info_print_table_row(1, "Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, \ + Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski"); + PUTS("</table>\n"); + } + if (flag & PHP_CREDITS_GENERAL) { /* Language */ + PUTS("<table border=5 width=\"600\">\n"); PUTS("<tr><th colspan=\"2\" bgcolor=\"" PHP_HEADER_COLOR "\">PHP 4.0 Authors</th></tr>\n"); php_info_print_table_header(2, "Contribution", "Authors"); - CREDIT_LINE("PHP Group", "Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, \ - Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski"); CREDIT_LINE("Zend Scripting Language Engine", "Andi Gutmans, Zeev Suraski"); CREDIT_LINE("Extension Module API", "Andi Gutmans, Zeev Suraski"); CREDIT_LINE("UNIX Build and Modularization", "Stig Bakken, Sascha Schumann"); CREDIT_LINE("Win32 Port", "Shane Caraveo, Zeev Suraski"); CREDIT_LINE("Server API (SAPI) Abstraction Layer", "Andi Gutmans, Shane Caraveo, Zeev Suraski"); - CREDIT_LINE("Apache SAPI Module", "Rasmus Lerdorf, Zeev Suraski"); - CREDIT_LINE("ISAPI SAPI Module", "Andi Gutmans, Zeev Suraski"); - CREDIT_LINE("CGI SAPI Module", "Rasmus Lerdorf, Stig Bakken"); - CREDIT_LINE("AOLserver SAPI Module", "Sascha Schumann"); - CREDIT_LINE("Servlet SAPI Module", "Sam Ruby"); - CREDIT_LINE("Roxen SAPI Module", "David Hedbor"); - CREDIT_LINE("thttpd SAPI Module", "Sascha Schumann"); + PUTS("</table>\n"); + } + + if (flag & PHP_CREDITS_GENERAL) { + /* SAPI Modules */ + + PUTS("<table border=5 width=\"600\">\n"); + PUTS("<tr><th colspan=\"2\" bgcolor=\"" PHP_HEADER_COLOR "\">SAPI Modules</th></tr>\n"); + php_info_print_table_header(2, "Contribution", "Authors"); + CREDIT_LINE("Apache", "Rasmus Lerdorf, Zeev Suraski"); + CREDIT_LINE("ISAPI", "Andi Gutmans, Zeev Suraski"); + CREDIT_LINE("CGI", "Rasmus Lerdorf, Stig Bakken"); + CREDIT_LINE("AOLserver", "Sascha Schumann"); + CREDIT_LINE("Java Servlet", "Sam Ruby"); + CREDIT_LINE("Roxen", "David Hedbor"); + CREDIT_LINE("thttpd", "Sascha Schumann"); PUTS("</table>\n"); } if (flag & PHP_CREDITS_MODULES) { /* Modules */ + PUTS("<table border=5 width=\"600\">\n"); PUTS("<tr><th colspan=\"2\" bgcolor=\"" PHP_HEADER_COLOR "\">Module Authors</th></tr>\n"); php_info_print_table_header(2, "Module", "Authors"); @@ -410,6 +429,13 @@ void register_phpinfo_constants(INIT_FUNC_ARGS) REGISTER_LONG_CONSTANT("INFO_VARIABLES", PHP_INFO_VARIABLES, CONST_PERSISTENT|CONST_CS); REGISTER_LONG_CONSTANT("INFO_LICENSE", PHP_INFO_LICENSE, CONST_PERSISTENT|CONST_CS); REGISTER_LONG_CONSTANT("INFO_ALL", PHP_INFO_ALL, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_GROUP", PHP_CREDITS_GROUP, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_GENERAL", PHP_CREDITS_GENERAL, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_SAPI", PHP_CREDITS_SAPI, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_MODULES", PHP_CREDITS_MODULES, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_DOCS", PHP_CREDITS_DOCS, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_FULLPAGE", PHP_CREDITS_FULLPAGE, CONST_PERSISTENT|CONST_CS); + REGISTER_LONG_CONSTANT("CREDITS_ALL", PHP_CREDITS_ALL, CONST_PERSISTENT|CONST_CS); } diff --git a/ext/standard/info.h b/ext/standard/info.h index 72aadf72ee..eaf7f38c6d 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -46,10 +46,12 @@ #define PHP_INFO_ALL 0xFFFFFFFF -#define PHP_CREDITS_GENERAL (1<<0) -#define PHP_CREDITS_MODULES (1<<1) -#define PHP_CREDITS_DOCS (1<<2) -#define PHP_CREDITS_FULLPAGE (1<<3) +#define PHP_CREDITS_GROUP (1<<0) +#define PHP_CREDITS_GENERAL (1<<1) +#define PHP_CREDITS_SAPI (1<<2) +#define PHP_CREDITS_MODULES (1<<3) +#define PHP_CREDITS_DOCS (1<<4) +#define PHP_CREDITS_FULLPAGE (1<<5) #define PHP_CREDITS_ALL 0xFFFFFFFF #define PHP_LOGO_GUID "PHPE9568F34-D428-11d2-A769-00AA001ACF42" diff --git a/sapi/isapi/PWS-php4.reg b/sapi/isapi/PWS-php4.reg new file mode 100644 index 0000000000..47804a946a --- /dev/null +++ b/sapi/isapi/PWS-php4.reg @@ -0,0 +1,5 @@ +REGEDIT4 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] +".php"="[PUT PATH HERE]\\php4isapi.dll" + diff --git a/sapi/isapi/php4isapi.c b/sapi/isapi/php4isapi.c index 8e6999a745..3ffb4da617 100644 --- a/sapi/isapi/php4isapi.c +++ b/sapi/isapi/php4isapi.c @@ -17,9 +17,14 @@ +----------------------------------------------------------------------+ */ -#if WIN32|WINNT +#ifdef PHP_WIN32 # include <windows.h> +# include <process.h> +#else +# define __try +# define __except(val) #endif + #include <httpext.h> #include <httpfilt.h> #include <httpext.h> @@ -29,6 +34,7 @@ #include "php_globals.h" #include "ext/standard/info.h" #include "php_variables.h" +#include "php_ini.h" #ifdef WITH_ZEUS #include "zeus.h" @@ -39,6 +45,7 @@ #define ISAPI_POST_DATA_BUF 1024 static zend_bool bFilterLoaded=0; +static zend_bool bTerminateThreadsOnError=0; static char *isapi_server_variables[] = { "ALL_HTTP", @@ -136,11 +143,10 @@ static int sapi_isapi_ub_write(const char *str, uint str_length) DWORD num_bytes = str_length; LPEXTENSION_CONTROL_BLOCK ecb; SLS_FETCH(); - ELS_FETCH(); ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context); if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) { - longjmp(EG(bailout), 1); + zend_bailout(); } return num_bytes; } @@ -235,6 +241,7 @@ static int php_isapi_startup(sapi_module_struct *sapi_module) || zend_startup_module(&php_isapi_module)==FAILURE) { return FAILURE; } else { + bTerminateThreadsOnError = (zend_bool) INI_INT("isapi.terminate_threads_on_error"); return SUCCESS; } } @@ -486,6 +493,16 @@ BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) } +static void my_endthread() +{ +#ifdef PHP_WIN32 + if (bTerminateThreadsOnError) { + _endthread(); + } +#endif +} + + DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { zend_file_handle file_handle; @@ -514,6 +531,7 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) efree(SG(request_info).cookie_data); } } __except(EXCEPTION_EXECUTE_HANDLER) { +#ifdef PHP_WIN32 if (_exception_code()==EXCEPTION_STACK_OVERFLOW) { LPBYTE lpPage; static SYSTEM_INFO si; @@ -533,28 +551,30 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) /* Free pages below current page */ if (!VirtualFree(mi.AllocationBase, (LPBYTE)lpPage - (LPBYTE) mi.AllocationBase, MEM_DECOMMIT)) { - ExitThread(0); + _endthread(); } /* Restore the guard page */ if (!VirtualProtect(lpPage, si.dwPageSize, PAGE_GUARD | PAGE_READWRITE, &dwOldProtect)) { - ExitThread(0); + _endthread(); } CG(unclean_shutdown)=1; php_isapi_report_exception("Stack overflow", sizeof("Stack overflow")-1 SLS_CC); } else if (_exception_code()==EXCEPTION_ACCESS_VIOLATION) { php_isapi_report_exception("Access violation", sizeof("Access violation")-1 SLS_CC); - ExitThread(0); + my_endthread(); } else { - ExitThread(0); + php_isapi_report_exception("Unknown fatal exception", sizeof("Unknown fatal exception")-1 SLS_CC); + my_endthread(); } +#endif } __try { php_request_shutdown(NULL); } __except(EXCEPTION_EXECUTE_HANDLER) { - ExitThread(0); + my_endthread(); } return HSE_STATUS_SUCCESS; diff --git a/tests/run.html b/tests/run.html new file mode 100644 index 0000000000..281e9e57c8 --- /dev/null +++ b/tests/run.html @@ -0,0 +1,11 @@ +<html> +<body> +<form action="run.php" method="POST"> + +<textarea name="code" cols=50 rows=20> +</textarea><br> +<input type="submit" value="Go!"> +</form> + +</body> +</html> diff --git a/tests/run.php b/tests/run.php new file mode 100644 index 0000000000..a6792b5af7 --- /dev/null +++ b/tests/run.php @@ -0,0 +1,17 @@ +<? +if (!isset($code)) { + exit("No code submitted."); +} +?> +<html> +<body> +Executing:<br> +<? +highlight_string("<?php \n$code\n?>"); +?> +<hr width="40%"> +<? +eval($code); +?> +</body> +</html>
\ No newline at end of file |