[PHP4BETA] CVS update: php4

From: Date: Mon, 26 Apr 1999 14:00:47 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-546@lists.php.net to get a copy of this message
Date: Monday April 26, 1999 @ 10:00 Author: zeev Update of /repository/php4 In directory php:/tmp/cvs-serv848 Modified Files: SAPI.c SAPI.h cgi_main.c configuration-parser.y fopen-wrappers.c fopen-wrappers.h getopt.c getopt.h main.c main.h mod_php3.c output.c output.h php.h php4.dsp php4.dsw php4ts.dsp php4ts.dsw php_globals.h request_info.c request_info.h Added Files: php4dll.dsp php4dllts.dsp Removed Files: php4libts.dsp Log Message: * Plenty of thread safety and Win32 work. * Changed PHP4 to compile as a DLL, both ISAPI and the the CGI run with the same DLL. * Switched to using the DLL runtime library under Win32. PHP will NOT work if compiled against the static library! * Removed yesterday's php4libts project (with php4dllts, it's obsolete). This *does* affect thread-unsafe Windows as well - the thread unsafe CGI is also dependant on the thread-unsafe DLL. Index: php4/SAPI.c diff -u php4/SAPI.c:1.1 php4/SAPI.c:1.2 --- php4/SAPI.c:1.1 Sun Apr 25 17:04:17 1999 +++ php4/SAPI.c Mon Apr 26 10:00:46 1999 @@ -1,16 +1,20 @@ #include "SAPI.h" +#ifdef ZTS #include "TSRM.h" +#endif #ifdef ZTS -int sapi_globals_id; +SAPI_API int sapi_globals_id; #endif +/* A true global (no need for thread safety) */ +sapi_functions_struct sapi_functions; -void sapi_startup() +void sapi_startup(sapi_functions_struct *sf) { + sapi_functions = *sf; #ifdef ZTS sapi_globals_id = ts_allocate_id(sizeof(sapi_globals_struct), NULL, NULL); #endif -} - +} \ No newline at end of file Index: php4/SAPI.h diff -u php4/SAPI.h:1.1 php4/SAPI.h:1.2 --- php4/SAPI.h:1.1 Sun Apr 25 17:04:17 1999 +++ php4/SAPI.h Mon Apr 26 10:00:46 1999 @@ -1,6 +1,18 @@ #ifndef _NEW_SAPI_H #define _NEW_SAPI_H + +#if WIN32||WINNT +# ifdef SAPI_EXPORTS +# define SAPI_API __declspec(dllexport) +# else +# define SAPI_API __declspec(dllimport) +# endif +#else +#define SAPI_API +#endif + + typedef struct { int (*ub_write)(const char *str, unsigned int str_length); } sapi_functions_struct; @@ -13,7 +25,7 @@ } sapi_globals_struct; -void sapi_startup(); +void sapi_startup(sapi_functions_struct *sf); #ifdef ZTS # define SLS_D sapi_globals_struct *sapi_globals @@ -22,7 +34,7 @@ # define SLS_CC , SLS_C # define SG(v) (sapi_globals->v) # define SLS_FETCH() sapi_globals_struct *sapi_globals = ts_resource(sapi_globals_id) -extern int sapi_globals_id; +SAPI_API extern int sapi_globals_id; #else # define SLS_D # define SLS_DC @@ -30,7 +42,7 @@ # define SLS_CC # define SG(v) (sapi_globals.v) # define SLS_FETCH() -extern ZEND_API sapi_globals_struct sapi_globals; +extern SAPI_API sapi_globals_struct sapi_globals; #endif Index: php4/cgi_main.c diff -u php4/cgi_main.c:1.1 php4/cgi_main.c:1.2 --- php4/cgi_main.c:1.1 Sun Apr 25 15:36:57 1999 +++ php4/cgi_main.c Mon Apr 26 10:00:46 1999 @@ -45,6 +45,7 @@ #include "zend_highlight.h" #include "zend_indent.h" + #if USE_SAPI #include "serverapi/sapi.h" void *gLock; @@ -57,12 +58,14 @@ #include "getopt.h" #endif -extern char *php3_ini_path; +PHPAPI extern char *php3_ini_path; #define PHP_MODE_STANDARD 1 #define PHP_MODE_HIGHLIGHT 2 #define PHP_MODE_INDENT 3 +PHPAPI extern char *optarg; +PHPAPI extern int optind; static int zend_cgibin_ub_write(const char *str, uint str_length) @@ -71,11 +74,40 @@ } -sapi_functions_struct sapi_functions = { +static sapi_functions_struct sapi_functions = { zend_cgibin_ub_write }; +static void php_cgi_usage(char *argv0) +{ + char *prog; + + prog = strrchr(argv0, '/'); + if (prog) { + prog++; + } else { + prog = "php"; + } + + php3_printf("Usage: %s [-q] [-h]" + " [-s]" + " [-v] [-i] [-f <file>] | " + "{<file> [args...]}\n" + " -q Quiet-mode. Suppress HTTP Header output.\n" + " -s Display colour syntax highlighted source.\n" + " -f<file> Parse <file>. Implies `-q'\n" + " -v Version number\n" + " -c<path> Look for php3.ini file in this directory\n" +#if SUPPORT_INTERACTIVE + " -a Run interactively\n" +#endif + " -e Generate extended information for debugger/profiler\n" + " -i PHP information\n" + " -h This help\n", prog); +} + + int main(int argc, char *argv[]) { int cgi = 0, c, i, len; @@ -144,7 +176,7 @@ #endif /* FORCE_CGI_REDIRECT */ } - if (php3_module_startup()==FAILURE) { + if (php_module_startup(&sapi_functions)==FAILURE) { return FAILURE; } #ifdef ZTS @@ -161,8 +193,8 @@ switch (c) { case 'f': if (!_cgi_started){ - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); + if (php_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { + php_module_shutdown(); return FAILURE; } } @@ -174,8 +206,8 @@ break; case 'v': if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); + if (php_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { + php_module_shutdown(); return FAILURE; } } @@ -184,8 +216,8 @@ break; case 'i': if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); + if (php_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { + php_module_shutdown(); return FAILURE; } } @@ -218,7 +250,7 @@ case '?': php3_noheader(); zend_output_startup(); - _php3_usage(argv[0]); + php_cgi_usage(argv[0]); exit(1); break; default: @@ -232,8 +264,8 @@ #endif if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); + if (php_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { + php_module_shutdown(); return FAILURE; } } @@ -286,8 +318,8 @@ } } #endif - php3_request_shutdown((void *) 0); - php3_module_shutdown(); + php_request_shutdown((void *) 0); + php_module_shutdown(); return FAILURE; } else if (file_handle.handle.fp && file_handle.handle.fp!=stdin) { /* #!php support */ @@ -304,7 +336,7 @@ switch (behavior) { case PHP_MODE_STANDARD: - php3_parse(&file_handle CLS_CC ELS_CC PLS_CC); + php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC); break; case PHP_MODE_HIGHLIGHT: { zend_syntax_highlighter_ini syntax_highlighter_ini; @@ -326,7 +358,7 @@ } php3_header(); /* Make sure headers have been sent */ - php3_request_shutdown((void *) 0); - php3_module_shutdown(); + php_request_shutdown((void *) 0); + php_module_shutdown(); return SUCCESS; } Index: php4/configuration-parser.y diff -u php4/configuration-parser.y:1.9 php4/configuration-parser.y:1.10 --- php4/configuration-parser.y:1.9 Fri Apr 23 20:11:48 1999 +++ php4/configuration-parser.y Mon Apr 26 10:00:46 1999 @@ -30,7 +30,7 @@ -/* $Id: configuration-parser.y,v 1.9 1999/04/24 00:11:48 zeev Exp $ */ +/* $Id: configuration-parser.y,v 1.10 1999/04/26 14:00:46 zeev Exp $ */ #define DEBUG_CFG_PARSER 1 #include "php.h" @@ -60,7 +60,7 @@ static HashTable configuration_hash; #ifndef THREAD_SAFE extern HashTable browser_hash; -extern char *php3_ini_path; +PHPAPI extern char *php3_ini_path; #endif static HashTable *active__php3_hash_table; static pval *current_section; Index: php4/fopen-wrappers.c diff -u php4/fopen-wrappers.c:1.10 php4/fopen-wrappers.c:1.11 --- php4/fopen-wrappers.c:1.10 Fri Apr 23 20:11:48 1999 +++ php4/fopen-wrappers.c Mon Apr 26 10:00:46 1999 @@ -27,7 +27,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.c,v 1.10 1999/04/24 00:11:48 zeev Exp $ */ +/* $Id: fopen-wrappers.c,v 1.11 1999/04/26 14:00:46 zeev Exp $ */ #include "php.h" #include "php_globals.h" @@ -198,7 +198,7 @@ #if CGI_BINARY || FHTTPD || USE_SAPI -FILE *php3_fopen_for_parser(void) +PHPAPI FILE *php3_fopen_for_parser(void) { FILE *fp; struct stat st; Index: php4/fopen-wrappers.h diff -u php4/fopen-wrappers.h:1.1.1.1 php4/fopen-wrappers.h:1.2 --- php4/fopen-wrappers.h:1.1.1.1 Wed Apr 7 17:02:07 1999 +++ php4/fopen-wrappers.h Mon Apr 26 10:00:46 1999 @@ -26,7 +26,7 @@ | Authors: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.h,v 1.1.1.1 1999/04/07 21:02:07 zeev Exp $ */ +/* $Id: fopen-wrappers.h,v 1.2 1999/04/26 14:00:46 zeev Exp $ */ #ifndef _FOPEN_WRAPPERS_H #define _FOPEN_WRAPPERS_H @@ -69,7 +69,7 @@ extern PHPAPI FILE *php3_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd); -extern FILE *php3_fopen_for_parser(void); +PHPAPI FILE *php3_fopen_for_parser(void); extern PHPAPI int _php3_check_open_basedir(char *path); Index: php4/getopt.c diff -u php4/getopt.c:1.1.1.1 php4/getopt.c:1.2 --- php4/getopt.c:1.1.1.1 Wed Apr 7 17:02:07 1999 +++ php4/getopt.c Mon Apr 26 10:00:46 1999 @@ -12,10 +12,10 @@ #define OPTERRARG (3) -char *optarg; -int optind = 1; -int opterr = 1; -int optopt; +PHPAPI char *optarg; +PHPAPI int optind = 1; +static int opterr = 1; +static int optopt; static int optiserr(int argc, char * const *argv, int oint, const char *optstr, @@ -44,8 +44,7 @@ return('?'); } -int -getopt(int argc, char* const *argv, const char *optstr) +PHPAPI int getopt(int argc, char* const *argv, const char *optstr) { static int optchr = 0; static int dash = 0; /* have already seen the - */ Index: php4/getopt.h diff -u php4/getopt.h:1.1.1.1 php4/getopt.h:1.2 --- php4/getopt.h:1.1.1.1 Wed Apr 7 17:02:07 1999 +++ php4/getopt.h Mon Apr 26 10:00:46 1999 @@ -1,9 +1,9 @@ /* Borrowed from Apache NT Port */ #include "php.h" -extern char *optarg; -extern int optind; +PHPAPI extern char *optarg; +PHPAPI extern int optind; extern int opterr; extern int optopt; -extern int getopt(int argc, char* const *argv, const char *optstr); +PHPAPI int getopt(int argc, char* const *argv, const char *optstr); Index: php4/main.c diff -u php4/main.c:1.33 php4/main.c:1.34 --- php4/main.c:1.33 Sun Apr 25 23:03:36 1999 +++ php4/main.c Mon Apr 26 10:00:46 1999 @@ -29,7 +29,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.33 1999/04/26 03:03:36 andi Exp $ */ +/* $Id: main.c,v 1.34 1999/04/26 14:00:46 zeev Exp $ */ #include <stdio.h> @@ -93,7 +93,7 @@ #ifndef ZTS php_core_globals core_globals; #else -int core_globals_id; +PHPAPI int core_globals_id; #endif void _php3_build_argv(char * ELS_DC); @@ -109,7 +109,7 @@ /* True globals (no need for thread safety) */ HashTable configuration_hash; -char *php3_ini_path = NULL; +PHPAPI char *php3_ini_path = NULL; #ifdef ZTS php_core_globals *main_core_globals=NULL; #endif @@ -606,37 +606,8 @@ -#ifndef NEW_SAPI -# if APACHE -static int zend_apache_ub_write(const char *str, uint str_length) +int php_request_startup(CLS_D ELS_DC PLS_DC) { - 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(); php3_set_timeout(PG(max_execution_time)); @@ -651,7 +622,7 @@ * memory. */ block_alarms(); - register_cleanup(php3_rqst->pool, NULL, php3_request_shutdown, php3_request_shutdown_for_exec); + register_cleanup(php3_rqst->pool, NULL, php_request_shutdown, php_request_shutdown_for_exec); unblock_alarms(); #endif @@ -675,7 +646,7 @@ } -void php3_request_shutdown_for_exec(void *dummy) +void php_request_shutdown_for_exec(void *dummy) { /* used to close fd's in the 3..255 range here, but it's problematic */ @@ -689,7 +660,7 @@ } -void php3_request_shutdown(void *dummy) +void php_request_shutdown(void *dummy) { #if FHTTPD char tmpline[128]; @@ -791,7 +762,7 @@ #endif -int php3_module_startup() +int php_module_startup(sapi_functions_struct *sf) { zend_utility_functions zuf; zend_utility_values zuv; @@ -829,9 +800,7 @@ main_core_globals = core_globals; #endif -#ifdef NEW_SAPI - sapi_startup(); -#endif + sapi_startup(sf); #if HAVE_SETLOCALE setlocale(LC_CTYPE, ""); @@ -870,12 +839,12 @@ -void php3_module_shutdown_for_exec(void) +void php_module_shutdown_for_exec(void) { /* used to close fd's in the range 3.255 here, but it's problematic */ } -void php3_module_shutdown() +void php_module_shutdown() { int module_number=0; /* for UNREGISTER_INI_ENTRIES() */ CLS_FETCH(); @@ -1144,7 +1113,7 @@ #include "logos.h" -void php3_parse(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC) +PHPAPI void php_execute_script(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; @@ -1199,305 +1168,8 @@ -#if CGI_BINARY - -void _php3_usage(char *argv0) -{ - char *prog; - - prog = strrchr(argv0, '/'); - if (prog) { - prog++; - } else { - prog = "php"; - } - - php3_printf("Usage: %s [-q] [-h]" - " [-s]" - " [-v] [-i] [-f <file>] | " - "{<file> [args...]}\n" - " -q Quiet-mode. Suppress HTTP Header output.\n" - " -s Display colour syntax highlighted source.\n" - " -f<file> Parse <file>. Implies `-q'\n" - " -v Version number\n" - " -c<path> Look for php3.ini file in this directory\n" -#if SUPPORT_INTERACTIVE - " -a Run interactively\n" -#endif - " -e Generate extended information for debugger/profiler\n" - " -i PHP information\n" - " -h This help\n", prog); -} - /* some systems are missing these from their header files */ -extern char *optarg; -extern int optind; - -#if THREAD_SAFE -extern flex_globals *yy_init_tls(void); -extern void yy_destroy_tls(void); -#endif - -#ifndef ZTS -int main(int argc, char *argv[]) -{ - int cgi = 0, c, i, len; - zend_file_handle file_handle; - char *s; -/* temporary locals */ - char *_cgi_filename=NULL; - int _cgi_started=0; - int behavior=PHP_MODE_STANDARD; -#if SUPPORT_INTERACTIVE - int interactive=0; -#endif -/* end of temporary locals */ -#ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - php_core_globals *core_globals; -#endif - - -#ifndef ZTS - if (setjmp(EG(bailout))!=0) { - return -1; - } -#endif - -#if WIN32|WINNT - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - - - /* Make sure we detect we are a cgi - a bit redundancy here, - but the default case is that we have to check only the first one. */ - if (getenv("SERVER_SOFTWARE") - || getenv("SERVER_NAME") - || getenv("GATEWAY_INTERFACE") - || getenv("REQUEST_METHOD")) { - cgi = 1; - if (argc > 1) - request_info.php_argv0 = strdup(argv[1]); - else request_info.php_argv0 = NULL; -#if FORCE_CGI_REDIRECT - if (!getenv("REDIRECT_STATUS")) { - PUTS("<b>Security Alert!</b> PHP CGI cannot be accessed directly.\n\ -\n\ -<P>This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\ -means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\ -set. This variable is set, for example, by Apache's Action directive redirect.\n\ -<P>You may disable this restriction by recompiling the PHP binary with the\n\ ---disable-force-cgi-redirect switch. If you do this and you have your PHP CGI\n\ -binary accessible somewhere in your web tree, people will be able to circumvent\n\ -.htaccess security by loading files through the PHP parser. A good way around\n\ -this is to define doc_root in your php3.ini file to something other than your\n\ -top-level DOCUMENT_ROOT. This way you can separate the part of your web space\n\n\ -which uses PHP from the normal part using .htaccess security. If you do not have\n\ -any .htaccess restrictions anywhere on your site you can leave doc_root undefined.\n\ -\n"); - - /* remove that detailed explanation some time */ - - return FAILURE; - } -#endif /* FORCE_CGI_REDIRECT */ - } - - if (php3_module_startup()==FAILURE) { - return FAILURE; - } -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); -#endif - - CG(extended_info) = 0; - - if (!cgi) { /* never execute the arguments if you are a CGI */ - request_info.php_argv0 = NULL; - while ((c = getopt(argc, argv, "c:qvisnaeh?vf:")) != -1) { - switch (c) { - case 'f': - if (!_cgi_started){ - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); - return FAILURE; - } - } - _cgi_started=1; - _cgi_filename = estrdup(optarg); - /* break missing intentionally */ - case 'q': - php3_noheader(); - break; - case 'v': - if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); - return FAILURE; - } - } - php3_printf("%s\n", PHP_VERSION); - exit(1); - break; - case 'i': - if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); - return FAILURE; - } - } - _cgi_started=1; - php3_TreatHeaders(); - _php3_info(); - exit(1); - break; - case 's': - behavior=PHP_MODE_HIGHLIGHT; - break; - case 'n': - behavior=PHP_MODE_INDENT; - break; - case 'c': - php3_ini_path = strdup(optarg); /* intentional leak */ - break; - case 'a': -#if SUPPORT_INTERACTIVE - printf("Interactive mode enabled\n\n"); - interactive=1; -#else - printf("Interactive mode not supported!\n\n"); -#endif - break; - case 'e': - CG(extended_info) = 1; - break; - case 'h': - case '?': - php3_noheader(); - zend_output_startup(); - _php3_usage(argv[0]); - exit(1); - break; - default: - break; - } - } - } /* not cgi */ - -#if SUPPORT_INTERACTIVE - EG(interactive) = interactive; -#endif - if (!_cgi_started) { - if (php3_request_startup(CLS_C ELS_CC PLS_CC)==FAILURE) { - php3_module_shutdown(); - return FAILURE; - } - } - file_handle.filename = "-"; - file_handle.type = ZEND_HANDLE_FP; - file_handle.handle.fp = stdin; - if (_cgi_filename) { - request_info.filename = _cgi_filename; - } - - php3_TreatHeaders(); - - if (!cgi) { - if (!request_info.query_string) { - for (i = optind, len = 0; i < argc; i++) - len += strlen(argv[i]) + 1; - - s = malloc(len + 1); /* leak - but only for command line version, so ok */ - *s = '\0'; /* we are pretending it came from the environment */ - for (i = optind, len = 0; i < argc; i++) { - strcat(s, argv[i]); - if (i < (argc - 1)) - strcat(s, "+"); - } - request_info.query_string = s; - } - if (!request_info.filename && argc > optind) - request_info.filename = argv[optind]; - } - /* If for some reason the CGI interface is not setting the - PATH_TRANSLATED correctly, request_info.filename is NULL. - We still call php3_fopen_for_parser, because if you set doc_root - or user_dir configuration directives, PATH_INFO is used to construct - the filename as a side effect of php3_fopen_for_parser. - */ - if (cgi || request_info.filename) { - file_handle.filename = request_info.filename; - file_handle.handle.fp = php3_fopen_for_parser(); - } - - if (cgi && !file_handle.handle.fp) { - PUTS("No input file specified.\n"); -#if 0 /* this is here for debuging under windows */ - if (argc) { - i = 0; - php3_printf("\nargc %d\n",argc); - while (i <= argc) { - php3_printf("%s\n",argv[i]); - i++; - } - } -#endif - php3_request_shutdown((void *) 0); - php3_module_shutdown(); - return FAILURE; - } else if (file_handle.handle.fp && file_handle.handle.fp!=stdin) { - /* #!php support */ - c = fgetc(file_handle.handle.fp); - if (c == '#') { - while (c != 10 && c != 13) { - c = fgetc(file_handle.handle.fp); /* skip to end of line */ - } - CG(zend_lineno)++; - } else { - rewind(file_handle.handle.fp); - } - } - - switch (behavior) { - case PHP_MODE_STANDARD: - php3_parse(&file_handle CLS_CC ELS_CC PLS_CC); - break; - case PHP_MODE_HIGHLIGHT: { - zend_syntax_highlighter_ini syntax_highlighter_ini; - - if (open_file_for_scanning(&file_handle CLS_CC)==SUCCESS) { - php_get_highlight_struct(&syntax_highlighter_ini); - zend_highlight(&syntax_highlighter_ini); - fclose(file_handle.handle.fp); - } - return 0; - } - break; - case PHP_MODE_INDENT: - open_file_for_scanning(&file_handle CLS_CC); - zend_indent(); - fclose(file_handle.handle.fp); - return 0; - break; - } - - php3_header(); /* Make sure headers have been sent */ - php3_request_shutdown((void *) 0); - php3_module_shutdown(); - return SUCCESS; -} -#endif /* CGI_BINARY */ - -#endif /* ZTS */ - - #if APACHE PHPAPI int apache_php3_module_main(request_rec * r, int fd, int display_source_mode) { @@ -1513,20 +1185,29 @@ php3_rqst = r; - if (php3_request_startup(CLS_C ELS_CC PLS_CC) == FAILURE) { + if (php_request_startup(CLS_C ELS_CC PLS_CC) == FAILURE) { return FAILURE; } php3_TreatHeaders(); file_handle.type = ZEND_HANDLE_FD; file_handle.handle.fd = fd; file_handle.filename = request_info.filename; - (void) php3_parse(&file_handle CLS_CC ELS_CC); + (void) php_execute_script(&file_handle CLS_CC ELS_CC); php3_header(); /* Make sure headers have been sent */ zend_end_ob_buffering(1); return (OK); } #endif /* APACHE */ + + +#if WIN32||WINNT +/* just so that this symbol gets exported... */ +PHPAPI void dummy_indent() +{ + zend_indent(); +} +#endif /* * Local variables: Index: php4/main.h diff -u php4/main.h:1.5 php4/main.h:1.6 --- php4/main.h:1.5 Fri Apr 23 20:11:49 1999 +++ php4/main.h Mon Apr 26 10:00:46 1999 @@ -29,7 +29,7 @@ */ -/* $Id: main.h,v 1.5 1999/04/24 00:11:49 zeev Exp $ */ +/* $Id: main.h,v 1.6 1999/04/26 14:00:46 zeev Exp $ */ #ifndef _MAIN_H @@ -37,13 +37,16 @@ #include "zend_globals.h" #include "php_globals.h" +#include "SAPI.h" -int php3_request_startup(CLS_D ELS_DC PLS_DC); -extern void php3_request_shutdown(void *dummy); -extern void php3_request_shutdown_for_exec(void *dummy); -extern int php3_module_startup(); -extern void php3_module_shutdown(); -extern void php3_module_shutdown_for_exec(void); +PHPAPI int php_request_startup(CLS_D ELS_DC PLS_DC); +PHPAPI void php_request_shutdown(void *dummy); +PHPAPI void php_request_shutdown_for_exec(void *dummy); +PHPAPI int php_module_startup(sapi_functions_struct *sf); +PHPAPI void php_module_shutdown(); +PHPAPI void php_module_shutdown_for_exec(void); + +PHPAPI void php_execute_script(zend_file_handle *primary_file CLS_DC ELS_DC PLS_DC); extern void php3_call_shutdown_functions(void); Index: php4/mod_php3.c diff -u php4/mod_php3.c:1.10 php4/mod_php3.c:1.11 --- php4/mod_php3.c:1.10 Fri Apr 23 20:11:49 1999 +++ php4/mod_php3.c Mon Apr 26 10:00:46 1999 @@ -28,7 +28,7 @@ | PHP4 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php3.c,v 1.10 1999/04/24 00:11:49 zeev Exp $ */ +/* $Id: mod_php3.c,v 1.11 1999/04/26 14:00:46 zeev Exp $ */ #include "httpd.h" #include "http_config.h" @@ -87,68 +87,10 @@ php_apache_info_struct php_apache_info; /* active config */ int apache_php3_module_main(request_rec * r, int fd, int display_source_mode); -extern int php3_module_startup(); -extern void php3_module_shutdown(); -extern void php3_module_shutdown_for_exec(); - -extern int tls_create(void); -extern int tls_destroy(void); -extern int tls_startup(void); -extern int tls_shutdown(void); +int php_module_startup(sapi_functions_struct *sf); +void php_module_shutdown(); +void php_module_shutdown_for_exec(); -#if WIN32|WINNT - -/* - we will want to change this to the apache api - process and thread entry and exit functions -*/ -BOOL WINAPI DllMain(HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) -{ - switch( ul_reason_for_call ) { - case DLL_PROCESS_ATTACH: - /* - I should be loading ini vars here - and doing whatever true global inits - need to be done - */ - if (!tls_startup()) - return 0; - if (!tls_create()) - return 0; - - break; - case DLL_THREAD_ATTACH: - if (!tls_create()) - return 0; - /* if (php3_module_startup()==FAILURE) { - return FAILURE; - } -*/ break; - case DLL_THREAD_DETACH: - if (!tls_destroy()) - return 0; -/* if (initialized) { - php3_module_shutdown(); - return SUCCESS; - } else { - return FAILURE; - } -*/ break; - case DLL_PROCESS_DETACH: - /* - close down anything down in process_attach - */ - if (!tls_destroy()) - return 0; - if (!tls_shutdown()) - return 0; - break; - } - return 1; -} -#endif void php3_save_umask() { @@ -156,11 +98,28 @@ umask(saved_umask); } + +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 +}; + + void php3_restore_umask() { umask(saved_umask); } + int send_php3(request_rec *r, int display_source_mode, char *filename) { int fd, retval; @@ -230,16 +189,19 @@ return OK; } + int send_parsed_php3(request_rec * r) { return send_php3(r, 0, NULL); } + int send_parsed_php3_source(request_rec * r) { return send_php3(r, 0, NULL); } + /* * Create the per-directory config structure with defaults */ @@ -299,10 +261,11 @@ return send_parsed_php3(r); } + void php3_init_handler(server_rec *s, pool *p) { - register_cleanup(p, NULL, php3_module_shutdown, php3_module_shutdown_for_exec); - php3_module_startup(); + register_cleanup(p, NULL, php_module_shutdown, php_module_shutdown_for_exec); + php_module_startup(&sapi_functions); #if MODULE_MAGIC_NUMBER >= 19980527 ap_add_version_component("PHP/" PHP_VERSION); #endif Index: php4/output.c diff -u php4/output.c:1.4 php4/output.c:1.5 --- php4/output.c:1.4 Sun Apr 25 15:35:44 1999 +++ php4/output.c Mon Apr 26 10:00:46 1999 @@ -43,7 +43,7 @@ * Main */ -void zend_output_startup() +PHPAPI void zend_output_startup() { ob_buffer = NULL; zend_body_write = zend_ub_body_write; Index: php4/output.h diff -u php4/output.h:1.1.1.1 php4/output.h:1.2 --- php4/output.h:1.1.1.1 Wed Apr 7 17:02:37 1999 +++ php4/output.h Mon Apr 26 10:00:46 1999 @@ -3,7 +3,7 @@ #include "php.h" -void zend_output_startup(); +PHPAPI void zend_output_startup(); /* exported output functions */ int (*zend_body_write)(const char *str, uint str_length); /* string output */ Index: php4/php.h diff -u php4/php.h:1.12 php4/php.h:1.13 --- php4/php.h:1.12 Sun Apr 25 15:35:44 1999 +++ php4/php.h Mon Apr 26 10:00:46 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.12 1999/04/25 19:35:44 andi Exp $ */ +/* $Id: php.h,v 1.13 1999/04/26 14:00:46 zeev Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -69,15 +69,15 @@ #if WIN32 #include "config.w32.h" #include "win95nt.h" -# if defined(COMPILE_DL) -# define PHPAPI __declspec(dllimport) -# else -# define PHPAPI __declspec(dllexport) -# endif +# ifdef PHP_EXPORTS +# define PHPAPI __declspec(dllexport) +# else +# define PHPAPI __declspec(dllimport) +# endif #else -# include "config.h" -# define PHPAPI -# define THREAD_LS +#include "config.h" +#define PHPAPI +#define THREAD_LS #endif @@ -314,12 +314,11 @@ /* global variables */ -#ifndef THREAD_SAFE extern pval *data; -#if (!PHP_ISAPI) +#if !(WIN32||WINNT) extern char **environ; #endif -#endif + extern PHPAPI int le_index_ptr; /* list entry type for index pointers */ extern void phperror(char *error); Index: php4/php4.dsp diff -u php4/php4.dsp:1.11 php4/php4.dsp:1.12 --- php4/php4.dsp:1.11 Sat Apr 24 15:10:02 1999 +++ php4/php4.dsp Mon Apr 26 10:00:46 1999 @@ -42,7 +42,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "include" /I "..\libzend" /I "." /I "regex\\" /I "d:\src\bind\include" /D "NDEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /Fr /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libzend" /I "." /I "regex\\" /I "..\bindlib" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /Fr /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -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 /nologo /version:3.0 /subsystem:console /machine:I386 /out:"Release\php.exe" /libpath:"lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"..\libzend\Release" +# ADD LINK32 php4nts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release\php.exe" /libpath:"Release" !ELSEIF "$(CFG)" == "php4 - Win32 Debug" @@ -67,7 +67,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "include" /I "..\libzend" /I "." /I "regex\\" /I "d:\src\bind\include" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /FR /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\libzend" /I "." /I "regex\\" /I "..\bindlib" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" @@ -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 libzend.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libcd" /out:"Debug\php.exe" /pdbtype:sept /libpath:"lib" /libpath:"\src\lib" /libpath:"d:\src\bind\lib" /libpath:"..\libzend\Debug" +# 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 php4nts.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"Debug\php.exe" /pdbtype:sept /libpath:"Debug" # SUBTRACT LINK32 /pdb:none !ENDIF @@ -85,605 +85,17 @@ # Name "php4 - Win32 Release" # Name "php4 - Win32 Debug" -# 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 +# PROP Default_Filter ".c" # Begin Source File -SOURCE=".\fopen-wrappers.c" +SOURCE=.\cgi_main.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 -# Begin Source File - -SOURCE=.\request_info.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=.\functions\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=.\functions\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=.\functions\mime.h -# End Source File -# Begin Source File - -SOURCE=.\functions\number.h -# End Source File -# Begin Source File - -SOURCE=.\ext\standard\pageinfo.h -# End Source File -# Begin Source File - -SOURCE=.\functions\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=.\functions\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=.\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)" == "php4 - Win32 Release" - -!ELSEIF "$(CFG)" == "php4 - Win32 Debug" - -# 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)" == "php4 - Win32 Release" - -!ELSEIF "$(CFG)" == "php4 - Win32 Debug" - -# 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/php4.dsw diff -u php4/php4.dsw:1.4 php4/php4.dsw:1.5 --- php4/php4.dsw:1.4 Wed Apr 21 11:34:31 1999 +++ php4/php4.dsw Mon Apr 26 10:00:46 1999 @@ -24,6 +24,21 @@ Package=<4> {{{ Begin Project Dependency + Project_Dep_Name php4dll + End Project Dependency +}}} + +############################################################################### + +Project: "php4dll"=.\php4dll.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency Project_Dep_Name libzend End Project Dependency }}} Index: php4/php4ts.dsp diff -u php4/php4ts.dsp:1.7 php4/php4ts.dsp:1.8 --- php4/php4ts.dsp:1.7 Sun Apr 25 15:35:44 1999 +++ php4/php4ts.dsp Mon Apr 26 10:00:46 1999 @@ -42,7 +42,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "include" /I "..\libzend" /I "." /I "regex\\" /I "d:\src\bind\include" /I "..\tsrm" /D "NDEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /D "ZTS" /D "TSRM_EXPORTS" /Fr /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libzend" /I "." /I "regex\\" /I "..\tsrm" /I "..\bindlib" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "ZTS" /D "WIN32" /D "_MBCS" /Fr /FD /c # SUBTRACT CPP /YX /Yc /Yu # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -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:"..\tsrm\release_TS" /libpath:"..\libzend\Release_TS" /libpath:"." +# ADD LINK32 php4ts.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 /nologo /version:3.0 /subsystem:console /machine:I386 /nodefaultlib:"libc.lib" /out:"Release_TS\php.exe" /libpath:"Release_TS" !ELSEIF "$(CFG)" == "php4ts - Win32 Debug_TS" @@ -67,7 +67,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "include" /I "..\libzend" /I "." /I "regex\\" /I "d:\src\bind\include" /I "..\tsrm" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "COMPILE_LIBZEND" /D "ZTS" /D "TSRM_EXPORTS" /FR /FD /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\libzend" /I "." /I "regex\\" /I "..\tsrm" /I "..\bindlib" /D "DEBUG" /D "_DEBUG" /D "MSVC5" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTS" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG" @@ -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 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" +# 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 php4ts.lib /nologo /version:3.0 /subsystem:console /debug /machine:I386 /nodefaultlib:"libcd" /nodefaultlib:"libcmt" /out:"Debug_TS\php.exe" /pdbtype:sept /libpath:"Debug_TS" # SUBTRACT LINK32 /pdb:none !ENDIF Index: php4/php4ts.dsw diff -u php4/php4ts.dsw:1.3 php4/php4ts.dsw:1.4 --- php4/php4ts.dsw:1.3 Sun Apr 25 15:35:44 1999 +++ php4/php4ts.dsw Mon Apr 26 10:00:46 1999 @@ -27,7 +27,7 @@ ############################################################################### -Project: "php4isapi"=.\php4isapi\php4isapi.dsp - Package Owner=<4> +Project: "php4dllts"=.\php4dllts.dsp - Package Owner=<4> Package=<5> {{{ @@ -39,16 +39,13 @@ 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> +Project: "php4isapi"=.\php4isapi\php4isapi.dsp - Package Owner=<4> Package=<5> {{{ @@ -56,6 +53,9 @@ Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name php4dllts + End Project Dependency }}} ############################################################################### @@ -68,14 +68,8 @@ Package=<4> {{{ - Begin Project Dependency - Project_Dep_Name libzendts - End Project Dependency - Begin Project Dependency - Project_Dep_Name TSRM - End Project Dependency Begin Project Dependency - Project_Dep_Name php4libts + Project_Dep_Name php4dllts End Project Dependency }}} Index: php4/php_globals.h diff -u php4/php_globals.h:1.9 php4/php_globals.h:1.10 --- php4/php_globals.h:1.9 Sat Apr 24 12:51:15 1999 +++ php4/php_globals.h Mon Apr 26 10:00:46 1999 @@ -12,7 +12,7 @@ # define PLS_CC , PLS_C # define PG(v) (core_globals->v) # define PLS_FETCH() php_core_globals *core_globals = ts_resource(core_globals_id) -extern int core_globals_id; +PHPAPI extern int core_globals_id; #else # define PLS_D # define PLS_DC Index: php4/request_info.c diff -u php4/request_info.c:1.4 php4/request_info.c:1.5 --- php4/request_info.c:1.4 Fri Apr 23 20:11:49 1999 +++ php4/request_info.c Mon Apr 26 10:00:46 1999 @@ -30,7 +30,7 @@ #include "php.h" #ifndef THREAD_SAFE -php3_request_info request_info; +PHPAPI php3_request_info request_info; #endif #if CGI_BINARY Index: php4/request_info.h diff -u php4/request_info.h:1.1.1.1 php4/request_info.h:1.2 --- php4/request_info.h:1.1.1.1 Wed Apr 7 17:02:43 1999 +++ php4/request_info.h Mon Apr 26 10:00:46 1999 @@ -47,7 +47,7 @@ } php3_request_info; #ifndef THREAD_SAFE -extern php3_request_info request_info; +PHPAPI extern php3_request_info request_info; #endif extern int php3_init_request_info(void *conf); -- PHP 4 Beta

« previous php.version4 (#546) next »