[PHP4BETA] CVS update: php4

From: Date: Sun, 25 Apr 1999 19:35:44 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-518@lists.php.net to get a copy of this message
Date: Sunday April 25, 1999 @ 15:35 Author: andi Update of /repository/php4 In directory php:/tmp/cvs-serv3468 Modified Files: main.c output.c php.h php4ts.dsp php4ts.dsw Log Message: * Fix a couple of thread safety issues * Add initial ISAPI support. Very very experimental. * In the thread safe version, generate php4 as a library so that we can link it with both php.exe and the ISAPI dll. We should probably consider doing that under all circumstances, under UNIX as well. The thread-unsafe version *should* be unharmed. Index: php4/main.c diff -u php4/main.c:1.31 php4/main.c:1.32 --- php4/main.c:1.31 Sat Apr 24 12:51:14 1999 +++ php4/main.c Sun Apr 25 15:35:43 1999 @@ -29,7 +29,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.31 1999/04/24 16:51:14 zeev Exp $ */ +/* $Id: main.c,v 1.32 1999/04/25 19:35:43 andi Exp $ */ #include <stdio.h> @@ -82,6 +82,9 @@ #endif #endif + +#include "SAPI.h" + #if MSVC5 || !defined(HAVE_GETOPT) #include "getopt.h" #endif @@ -107,6 +110,9 @@ /* True globals (no need for thread safety) */ HashTable configuration_hash; char *php3_ini_path = NULL; +#ifdef ZTS +php_core_globals *main_core_globals; +#endif static PHP_INI_MH(OnSetPrecision) @@ -599,6 +605,36 @@ } + +#ifndef NEW_SAPI +# if APACHE +static int zend_apache_ub_write(const char *str, uint str_length) +{ + if (php3_rqst) { + return rwrite(str, str_length, php3_rqst); + } else { + return fwrite(str, 1, str_length, stdout); + } +} + +sapi_functions_struct sapi_functions = { + zend_apache_ub_write +}; + +# elif CGI_BINARY + +static int zend_cgibin_ub_write(const char *str, uint str_length) +{ + return fwrite(str, 1, str_length, stdout); +} + +sapi_functions_struct sapi_functions = { + zend_cgibin_ub_write +}; +# endif +#endif + + int php3_request_startup(CLS_D ELS_DC PLS_DC) { zend_output_startup(); @@ -745,6 +781,14 @@ } +#ifdef ZTS +static core_globals_ctor(php_core_globals *core_globals) +{ + *core_globals = *main_core_globals; +} +#endif + + int php3_module_startup() { zend_utility_functions zuf; @@ -778,10 +822,15 @@ zend_startup(&zuf, NULL); #ifdef ZTS - core_globals_id = ts_allocate_id(sizeof(php_core_globals), NULL, NULL); + core_globals_id = ts_allocate_id(sizeof(php_core_globals), core_globals_ctor, NULL); core_globals = ts_resource(core_globals_id); + main_core_globals = core_globals; #endif +#ifdef NEW_SAPI + sapi_startup(); +#endif + #if HAVE_SETLOCALE setlocale(LC_CTYPE, ""); #endif @@ -1093,7 +1142,7 @@ #include "logos.h" -static void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) { zend_file_handle *prepend_file_p, *append_file_p; zend_file_handle prepend_file, append_file; @@ -1150,7 +1199,7 @@ #if CGI_BINARY -static void _php3_usage(char *argv0) +void _php3_usage(char *argv0) { char *prog; @@ -1187,6 +1236,7 @@ extern void yy_destroy_tls(void); #endif +#ifndef ZTS int main(int argc, char *argv[]) { int cgi = 0, c, i, len; @@ -1442,6 +1492,8 @@ return SUCCESS; } #endif /* CGI_BINARY */ + +#endif /* ZTS */ #if APACHE Index: php4/output.c diff -u php4/output.c:1.3 php4/output.c:1.4 --- php4/output.c:1.3 Fri Apr 23 20:11:49 1999 +++ php4/output.c Sun Apr 25 15:35:44 1999 @@ -16,6 +16,7 @@ #include "php.h" #include "ext/standard/head.h" +#include "SAPI.h" /* output functions */ int (*zend_body_write)(const char *str, uint str_length); /* string output */ @@ -37,14 +38,7 @@ /* HEAD support */ static int header_request; -/* wrappers */ -#if APACHE -static int zend_apache_ub_write(const char *str, uint str_length); -#elif CGI_BINARY -static int zend_cgibin_ub_write(const char *str, uint str_length); -#endif - /* * Main */ @@ -54,11 +48,7 @@ ob_buffer = NULL; zend_body_write = zend_ub_body_write; header_request=0; -#if APACHE - zend_header_write = zend_apache_ub_write; -#elif CGI_BINARY - zend_header_write = zend_cgibin_ub_write; -#endif + zend_header_write = sapi_functions.ub_write; } @@ -191,29 +181,6 @@ return 0; } } - - -#if APACHE - -static int zend_apache_ub_write(const char *str, uint str_length) -{ - if (php3_rqst) { - return rwrite(str, str_length, php3_rqst); - } else { - return fwrite(str, 1, str_length, stdout); - } -} - -#elif CGI_BINARY - -static int zend_cgibin_ub_write(const char *str, uint str_length) -{ - return fwrite(str, 1, str_length, stdout); -} - - - -#endif /* Index: php4/php.h diff -u php4/php.h:1.11 php4/php.h:1.12 --- php4/php.h:1.11 Fri Apr 23 20:11:49 1999 +++ php4/php.h Sun Apr 25 15:35:44 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.11 1999/04/24 00:11:49 zeev Exp $ */ +/* $Id: php.h,v 1.12 1999/04/25 19:35:44 andi Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -66,7 +66,7 @@ */ -#if MSVC5 +#if WIN32 #include "config.w32.h" #include "win95nt.h" # if defined(COMPILE_DL) Index: php4/php4ts.dsp diff -u php4/php4ts.dsp:1.6 php4/php4ts.dsp:1.7 --- php4/php4ts.dsp:1.6 Sat Apr 24 15:10:02 1999 +++ php4/php4ts.dsp Sun Apr 25 15:35:44 1999 @@ -51,7 +51,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 lib44bsd95.lib resolv.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libzendts.lib tsrm.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"..\tsrm\release_TS" /libpath:"..\libzend\Release_TS" +# ADD LINK32 lib44bsd95.lib resolv.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libzendts.lib tsrm.lib /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"lib" /libpath:"..\tsrm\release_TS" /libpath:"..\libzend\Release_TS" /libpath:"." !ELSEIF "$(CFG)" == "php4ts - Win32 Debug_TS" @@ -76,7 +76,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 lib44bsd95.lib resolv.lib winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib TSRM.lib libzendts.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"Debug_TS\php.exe" /pdbtype:sept /libpath:"lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"..\TSRM\debug_ts" /libpath:"..\libzend\Debug_TS" +# ADD LINK32 winmm.lib wsock32.lib netapi32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib TSRM.lib libzendts.lib php4libts.lib lib44bsd95.lib resolv.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"Debug_TS\php.exe" /pdbtype:sept /libpath:"lib" /libpath:"..\TSRM\debug_ts" /libpath:"..\libzend\Debug_TS" /libpath:"Debug_TS" # SUBTRACT LINK32 /pdb:none !ENDIF @@ -85,609 +85,17 @@ # Name "php4ts - Win32 Release_TS" # Name "php4ts - Win32 Debug_TS" -# Begin Group "Core" - -# PROP Default_Filter "" # Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=".\configuration-parser.c" -# End Source File -# Begin Source File - -SOURCE=".\configuration-scanner.c" -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\cyr_convert.c -# End Source File -# Begin Source File - -SOURCE=".\fopen-wrappers.c" -# End Source File -# Begin Source File - -SOURCE=.\getopt.c -# End Source File -# Begin Source File - -SOURCE=.\internal_functions.c -# End Source File -# Begin Source File - -SOURCE=.\main.c -# End Source File -# Begin Source File - -SOURCE=.\output.c -# End Source File -# Begin Source File -SOURCE=.\php3_realpath.c -# End Source File -# Begin Source File - -SOURCE=.\php_ini.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\quot_print.c -# End Source File +# PROP Default_Filter ".c" # Begin Source File -SOURCE=.\request_info.c +SOURCE=.\cgi_main.c # End Source File -# Begin Source File - -SOURCE=.\safe_mode.c -# End Source File # End Group # Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\config.w32.h -# End Source File -# Begin Source File - -SOURCE=".\configuration-parser.h" -# End Source File -# Begin Source File - -SOURCE=".\configuration-parser.tab.h" -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\cyr_convert.h -# End Source File -# Begin Source File - -SOURCE=.\getopt.h -# End Source File -# Begin Source File - -SOURCE=.\internal_functions_registry.h -# End Source File -# Begin Source File - -SOURCE=.\logos.h -# End Source File -# Begin Source File - -SOURCE=.\main.h -# End Source File -# Begin Source File - -SOURCE=.\output.h -# End Source File -# Begin Source File - -SOURCE=.\php.h -# End Source File -# Begin Source File - -SOURCE=.\php3_compat.h -# End Source File -# Begin Source File - -SOURCE=.\php3_realpath.h -# End Source File -# Begin Source File - -SOURCE=.\php_globals.h -# End Source File -# Begin Source File - -SOURCE=.\php_ini.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\quot_print.h -# End Source File -# Begin Source File - -SOURCE=.\request_info.h -# End Source File -# Begin Source File - -SOURCE=.\safe_mode.h -# End Source File -# Begin Source File - -SOURCE=.\win95nt.h -# End Source File -# End Group -# End Group -# Begin Group "Function Modules" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ext\apache\apache.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\base64.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\basic_functions.c -# End Source File -# Begin Source File - -SOURCE=.\ext\bcmath\bcmath.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\browscap.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\datetime.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\dir.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\dl.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\dns.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\exec.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\file.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\filestat.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\flock_compat.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\formatted_print.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\fsock.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\head.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\html.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\image.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\info.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\iptc.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\link.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\mail.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\math.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\md5.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\microtime.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\mime.c -# End Source File -# Begin Source File - -SOURCE=.\ext\bcmath\number.c -# End Source File -# Begin Source File - -SOURCE=.\ext\odbc\odbc.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\pack.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\pageinfo.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\post.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\rand.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\reg.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\soundex.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\string.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\syslog.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\type.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\uniqid.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\url.c -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\var.c -# End Source File -# End Group -# Begin Group "Header Files No. 1" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ext\standard\base64.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\basic_functions.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\datetime.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\dl.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\dns.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\exec.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\file.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\flock_compat.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\fsock.h -# End Source File -# Begin Source File - -SOURCE=.\functions\global.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\head.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\html.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\md5.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\mime.h -# End Source File -# Begin Source File - -SOURCE=.\ext\bcmath\number.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=.\ext\bcmath\php3_bcmath.h -# End Source File -# Begin Source File - -SOURCE=.\functions\php3_dir.h -# End Source File -# Begin Source File - -SOURCE=.\functions\php3_filestat.h -# End Source File -# Begin Source File - -SOURCE=.\functions\php3_ldap.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\php3_mail.h -# End Source File -# Begin Source File - -SOURCE=.\ext\odbc\php3_odbc.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\php3_string.h -# End Source File -# Begin Source File - -SOURCE=.\functions\php3_string.h -# End Source File -# Begin Source File - -SOURCE=.\functions\php3_syslog.h -# End Source File -# Begin Source File - -SOURCE=.\functions\phpdir.h -# End Source File -# Begin Source File - -SOURCE=.\functions\phpmath.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\post.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\reg.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\type.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\uniqid.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\url.h -# End Source File -# End Group -# Begin Group "Regular Expressions" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\regex\regcomp.c -# End Source File -# Begin Source File -SOURCE=.\regex\regerror.c -# End Source File -# Begin Source File - -SOURCE=.\regex\regexec.c -# End Source File -# Begin Source File - -SOURCE=.\regex\regfree.c -# End Source File -# End Group -# End Group -# Begin Group "Win32" - -# PROP Default_Filter "" -# Begin Group "Source Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ext\com\COM.c -# End Source File -# Begin Source File - -SOURCE=.\win32\pwd.c -# End Source File -# Begin Source File - -SOURCE=.\win32\readdir.c -# End Source File -# Begin Source File - -SOURCE=.\win32\registry.c -# End Source File -# Begin Source File - -SOURCE=.\win32\sendmail.c -# End Source File -# Begin Source File - -SOURCE=.\win32\time.c -# End Source File -# Begin Source File - -SOURCE=.\win32\wfile.c -# End Source File -# Begin Source File - -SOURCE=.\dl\snmp\winsnmp.c -# End Source File -# Begin Source File - -SOURCE=.\win32\winutil.c -# End Source File -# Begin Source File - -SOURCE=.\win32\wsyslog.c -# End Source File -# End Group -# Begin Group "Header Files No. 2" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\win32\grp.h -# End Source File -# Begin Source File - -SOURCE=.\win32\param.h -# End Source File -# Begin Source File - -SOURCE=.\ext\com\php3_COM.h -# End Source File -# Begin Source File - -SOURCE=.\win32\php_registry.h -# End Source File -# Begin Source File - -SOURCE=.\win32\pwd.h -# End Source File -# Begin Source File - -SOURCE=.\win32\readdir.h -# End Source File -# Begin Source File - -SOURCE=.\win32\sendmail.h -# End Source File -# Begin Source File - -SOURCE=.\win32\syslog.h -# End Source File -# Begin Source File - -SOURCE=.\win32\time.h -# End Source File -# Begin Source File - -SOURCE=.\win32\unistd.h -# End Source File -# Begin Source File - -SOURCE=.\win32\wfile.h -# End Source File -# End Group -# End Group -# Begin Group "Parsers" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=".\configuration-parser.y" - -!IF "$(CFG)" == "php4ts - Win32 Release_TS" - -!ELSEIF "$(CFG)" == "php4ts - Win32 Debug_TS" - -# Begin Custom Build -InputDir=. -InputPath=".\configuration-parser.y" - -BuildCmds= \ - bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y - -"$(InputDir)\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) - -"$(InputDir)\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - $(BuildCmds) -# End Custom Build - -!ENDIF - -# End Source File -# End Group -# Begin Group "Scanners" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=".\configuration-scanner.l" - -!IF "$(CFG)" == "php4ts - Win32 Release_TS" - -!ELSEIF "$(CFG)" == "php4ts - Win32 Debug_TS" - -# Begin Custom Build -InputPath=".\configuration-scanner.l" - -"configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l - -# End Custom Build - -!ENDIF - -# End Source File +# PROP Default_Filter ".h" # End Group # End Target # End Project Index: php4/php4ts.dsw diff -u php4/php4ts.dsw:1.2 php4/php4ts.dsw:1.3 --- php4/php4ts.dsw:1.2 Wed Apr 21 13:28:54 1999 +++ php4/php4ts.dsw Sun Apr 25 15:35:44 1999 @@ -27,6 +27,39 @@ ############################################################################### +Project: "php4isapi"=.\php4isapi\php4isapi.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libzendts + End Project Dependency + Begin Project Dependency + Project_Dep_Name php4libts + End Project Dependency + Begin Project Dependency + Project_Dep_Name TSRM + End Project Dependency +}}} + +############################################################################### + +Project: "php4libts"=.\php4libts.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "php4ts"=.\php4ts.dsp - Package Owner=<4> Package=<5> @@ -40,6 +73,9 @@ End Project Dependency Begin Project Dependency Project_Dep_Name TSRM + End Project Dependency + Begin Project Dependency + Project_Dep_Name php4libts End Project Dependency }}} -- PHP 4 Beta

« previous php.version4 (#518) next »