[PHP4BETA] CVS update: php4

From: Date: Tue, 11 May 1999 00:01:41 +0000
Subject: [PHP4BETA] CVS update: php4
Groups: php.version4 
Request: Send a blank email to php-version4+get-749@lists.php.net to get a copy of this message
Date: Monday May 10, 1999 @ 20:01 Author: zeev Update of /repository/php4 In directory php:/tmp/cvs-serv20087 Modified Files: Makefile.in alloca.c configure.in.in genif.sh libphp3.module.in main.c mod_php3.c php.h php3_sprintf.c request_info.c snprintf.c Added Files: php_regex.h Log Message: * Get Apache to work. POST doesn't work yet. * There are now -I directives for the absolute path of php4, php4/libzend and the builddir for the Apache module, so we can #include any php/Zend header. * Rename config.h to php_config.h Index: php4/Makefile.in diff -u php4/Makefile.in:1.27 php4/Makefile.in:1.28 --- php4/Makefile.in:1.27 Wed May 5 17:47:03 1999 +++ php4/Makefile.in Mon May 10 20:01:41 1999 @@ -24,7 +24,7 @@ # +----------------------------------------------------------------------+ # -# $Id: Makefile.in,v 1.27 1999/05/05 21:47:03 zeev Exp $ +# $Id: Makefile.in,v 1.28 1999/05/11 00:01:41 zeev Exp $ # prefix = @prefix@ @@ -124,7 +124,7 @@ distclean: clean distclean-recursive -rm -f *-parser.[ch] *-scanner.c *.output -rm -f config.status config.cache config.log - -rm -f Makefile Makefile.depend config.h build-defs.h + -rm -f Makefile Makefile.depend php_config.h build-defs.h -rm -f libphp3.module stamp-h -rm -f regex/*.o regex/*.a regex/*.ih -rm -f doc/checkdoc doc/funcparse doc/version.ent @@ -144,8 +144,8 @@ config.status: configure ./config.status --recheck -build-defs.h config.h: stamp-h -stamp-h: config.h.in config.status +build-defs.h php_config.h: stamp-h +stamp-h: php_config.h.in config.status CONFIG_FILES='build-defs.h stamp-h' ./config.status Makefile: Makefile.in config.status @@ -158,7 +158,7 @@ configure: @MAINT@ configure.in aclocal.m4 cd $(srcdir) && autoconf -config.h.in: @MAINT@ stamp-h.in +php_config.h.in: @MAINT@ stamp-h.in stamp-h.in: configure.in aclocal.m4 acconfig.h cd ${srcdir} && autoheader && touch ${srcdir}/stamp-h.in Index: php4/alloca.c diff -u php4/alloca.c:1.1.1.1 php4/alloca.c:1.2 --- php4/alloca.c:1.1.1.1 Wed Apr 7 17:00:57 1999 +++ php4/alloca.c Mon May 10 20:01:41 1999 @@ -21,7 +21,7 @@ allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ -#include <config.h> +#include "php_config.h" #if !HAVE_ALLOCA Index: php4/configure.in.in diff -u php4/configure.in.in:1.26 php4/configure.in.in:1.27 --- php4/configure.in.in:1.26 Sat May 8 14:16:29 1999 +++ php4/configure.in.in Mon May 10 20:01:41 1999 @@ -1,4 +1,4 @@ -dnl $Id: configure.in.in,v 1.26 1999/05/08 18:16:29 andrey Exp $ -*- sh -*- +dnl $Id: configure.in.in,v 1.27 1999/05/11 00:01:41 zeev Exp $ -*- sh -*- dnl Process this file with autoconf to produce a configure script. @@ -57,7 +57,7 @@ fi AC_SUBST(PHP_VERSION) -AM_CONFIG_HEADER(config.h) +AM_CONFIG_HEADER(php_config.h) AM_MAINTAINER_MODE dnl We want this one before the checks, so the checks can modify CFLAGS. @@ -348,8 +348,12 @@ ]) -APACHE_INSTALL_FILES="$srcdir/mod_php3.* $srcdir/php_version.h libphp3.module $srcdir/SAPI.h" +APACHE_INSTALL_FILES="$srcdir/mod_php3.* libphp3.module" +abs_srcdir=(cd $srcdir; pwd) +abs_builddir=pwd +AC_SUBST(abs_srcdir) +AC_SUBST(abs_builddir) AC_MSG_CHECKING(for Apache module support via DSO through APACI) AC_ARG_WITH(shared-apache, @@ -876,7 +880,7 @@ echo "creating internal_functions.c" extensions=\grep '^s.@EXT_SUBDIRS@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\ mv -f internal_functions.c internal_functions.c.old 2>/dev/null -sh $srcdir/genif.sh $srcdir/internal_functions.c.in \$srcdir \$extensions > internal_functions.c +sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then echo "internal_functions.c is unchanged" mv internal_functions.c.old internal_functions.c Index: php4/genif.sh diff -u php4/genif.sh:1.4 php4/genif.sh:1.5 --- php4/genif.sh:1.4 Sat May 8 18:00:02 1999 +++ php4/genif.sh Mon May 10 20:01:41 1999 @@ -1,6 +1,6 @@ #! /bin/sh -# $Id: genif.sh,v 1.4 1999/05/08 22:00:02 sas Exp $ +# $Id: genif.sh,v 1.5 1999/05/11 00:01:41 zeev Exp $ # replacement for genif.pl infile="$1" @@ -20,7 +20,7 @@ module_ptrs=" phpext_${ext}_ptr,\\\n$module_ptrs" for pre in php3 php php4 zend; do hdrfile="ext/$ext/${pre}_${ext}.h" - if test -f $hdrfile ; then + if test -f "$srcdir/$hdrfile" ; then includes="#include \"$hdrfile\"\\\n$includes" fi done Index: php4/libphp3.module.in diff -u php4/libphp3.module.in:1.3 php4/libphp3.module.in:1.4 --- php4/libphp3.module.in:1.3 Fri Apr 23 08:11:37 1999 +++ php4/libphp3.module.in Mon May 10 20:01:41 1999 @@ -3,5 +3,5 @@ RULE_WANTHSREGEX=@HSREGEX@ LIBS="@PHP_LIBS@ @EXTRA_LIBS@ @LIBS@ @RDYNAMIC_LFLAGS@ $LIBS" RULE_HIDE=yes -ConfigEnd - + CFLAGS="$CFLAGS -I@abs_srcdir@ -I@abs_srcdir@/libzend -I@abs_builddir@" +ConfigEnd \ No newline at end of file Index: php4/main.c diff -u php4/main.c:1.52 php4/main.c:1.53 --- php4/main.c:1.52 Mon May 10 16:40:45 1999 +++ php4/main.c Mon May 10 20:01:41 1999 @@ -29,7 +29,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: main.c,v 1.52 1999/05/10 20:40:45 andrey Exp $ */ +/* $Id: main.c,v 1.53 1999/05/11 00:01:41 zeev Exp $ */ #include <stdio.h> @@ -921,6 +921,7 @@ case 'g': case 'G': if (!_gpc_flags[2]) { + printf("Parsing GET data: '%s'\n", SG(request_info).query_string); php3_treat_data(PARSE_GET, NULL); /* GET Data */ _gpc_flags[2]=1; } @@ -1188,7 +1189,7 @@ /* some systems are missing these from their header files */ #if APACHE -PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode) +PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode SLS_DC) { zend_file_handle file_handle; #ifdef ZTS @@ -1200,8 +1201,6 @@ php_core_globals *core_globals=&pcg; #endif SLS_FETCH(); - - SG(server_context) = r; if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) { return FAILURE; Index: php4/mod_php3.c diff -u php4/mod_php3.c:1.15 php4/mod_php3.c:1.16 --- php4/mod_php3.c:1.15 Sun May 9 04:47:48 1999 +++ php4/mod_php3.c Mon May 10 20:01:41 1999 @@ -25,10 +25,10 @@ +----------------------------------------------------------------------+ | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | | (with helpful hints from Dean Gaudet <dgaudet@arctic.org> | - | PHP4 patches by Zeev Suraski <zeev@zend.com> | + | PHP 4.0 patches by Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: mod_php3.c,v 1.15 1999/05/09 08:47:48 zeev Exp $ */ +/* $Id: mod_php3.c,v 1.16 1999/05/11 00:01:41 zeev Exp $ */ #include "httpd.h" #include "http_config.h" @@ -44,27 +44,11 @@ #include "http_protocol.h" #include "http_request.h" #include "http_log.h" -#include "SAPI.h" - - -/* These are taken out of php_ini.h - * they must be updated if php_ini.h changes! - */ -#define PHP_INI_USER (1<<0) -#define PHP_INI_PERDIR (1<<1) -#define PHP_INI_SYSTEM (1<<2) -/* These are taken out of main.h - * they must be updated if main.h changes! - */ - -int apache_php3_module_main(request_rec * r, int fd, int display_source_mode); -int php_module_startup(sapi_module_struct *sf); -void php_module_shutdown(); -void php_module_shutdown_for_exec(); -int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals); - -int php3_error(int type, const char *format, ...); +#include "php.h" +#include "php_ini.h" +#include "SAPI.h" +#include "main.h" #include "util_script.h" @@ -74,6 +58,8 @@ # include "mod_dav.h" #endif +PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode SLS_DC); + /* ### these should be defined in mod_php3.h or somewhere else */ #define USE_PATH 1 #define IGNORE_URL 2 @@ -120,15 +106,15 @@ } -char *sapi_apache_read_post(SLS_D) +int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC) { - return NULL; + return 0; } char *sapi_apache_read_cookies(SLS_D) { - return table_get(r->subprocess_env, "HTTP_COOKIE"); + return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE"); } @@ -146,11 +132,11 @@ *p = 0; do { - header_content++ + header_content++; } while (*header_content==' '); if (!strcasecmp(header_name, "Content-Type")) { - r->content_type = pstrdup(header_content); + r->content_type = pstrdup(r->pool, header_content); } else if (!strcasecmp(header_name, "Location")) { r->status = REDIRECT; } else { @@ -163,7 +149,7 @@ } -void sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC) +int sapi_apache_send_headers(sapi_headers_struct *sapi_headers SLS_DC) { send_http_header((request_rec *) SG(server_context)); return SAPI_HEADER_SENT_SUCCESSFULLY; @@ -195,9 +181,24 @@ } +static void init_request_info(SLS_D) +{ + request_rec *r = ((request_rec *) SG(server_context)); + char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH"); + + SG(request_info).query_string = r->args; + SG(request_info).path_translated = r->filename; + SG(request_info).request_uri = r->uri; + SG(request_info).request_method = r->method; + SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE"); + SG(request_info).content_length = (content_length ? atoi(content_length) : 0); +} + + int send_php3(request_rec *r, int display_source_mode, char *filename) { int fd, retval; + SLS_FETCH(); /* We don't accept OPTIONS requests, but take everything else */ if (r->method_number == M_OPTIONS) { @@ -251,11 +252,15 @@ /* Init timeout */ hard_timeout("send", r); + SG(server_context) = r; + init_request_info(SLS_C); + php3_save_umask(); chdir_file(filename); add_common_vars(r); add_cgi_vars(r); - apache_php3_module_main(r, fd, display_source_mode); + init_request_info(); + apache_php3_module_main(r, fd, display_source_mode SLS_CC); /* Done, restore umask, turn off timeout, close file and return */ php3_restore_umask(); Index: php4/php.h diff -u php4/php.h:1.14 php4/php.h:1.15 --- php4/php.h:1.14 Mon Apr 26 13:26:32 1999 +++ php4/php.h Mon May 10 20:01:41 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.14 1999/04/26 17:26:32 zeev Exp $ */ +/* $Id: php.h,v 1.15 1999/05/11 00:01:41 zeev Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -75,7 +75,7 @@ # define PHPAPI __declspec(dllimport) # endif #else -#include "config.h" +#include "php_config.h" #define PHPAPI #define THREAD_LS #endif @@ -150,16 +150,6 @@ #define pval_copy_constructor zval_copy_ctor #define pval_destructor zval_dtor - -#if REGEX -#include "regex/regex.h" -#define _REGEX_H 1 /* this should stop Apache from loading the system version of regex.h */ -#define _RX_H 1 /* Try defining these for Linux to */ -#define __REGEXP_LIBRARY_H__ 1 /* avoid Apache including regex.h */ -#define _H_REGEX 1 /* This one is for AIX */ -#else -#include <regex.h> -#endif #if STDC_HEADERS # include <string.h> Index: php4/php3_sprintf.c diff -u php4/php3_sprintf.c:1.1.1.1 php4/php3_sprintf.c:1.2 --- php4/php3_sprintf.c:1.1.1.1 Wed Apr 7 17:02:40 1999 +++ php4/php3_sprintf.c Mon May 10 20:01:41 1999 @@ -28,9 +28,9 @@ +----------------------------------------------------------------------+ */ -/* $Id: php3_sprintf.c,v 1.1.1.1 1999/04/07 21:02:40 zeev Exp $ */ +/* $Id: php3_sprintf.c,v 1.2 1999/05/11 00:01:41 zeev Exp $ */ -#include "config.h" +#include "php_config.h" #include <stdio.h> #include <stdarg.h> Index: php4/request_info.c diff -u php4/request_info.c:1.12 php4/request_info.c:1.13 --- php4/request_info.c:1.12 Sun May 9 09:57:09 1999 +++ php4/request_info.c Mon May 10 20:01:41 1999 @@ -92,23 +92,13 @@ #if APACHE int php3_init_request_info(void *conf) { - const char *buf; request_rec *r; SLS_FETCH(); r = ((request_rec *) SG(server_context)); - SG(request_info).query_string = r->args; - SG(request_info).path_translated = r->filename; - SG(request_info).request_uri = r->uri; request_info.current_user = NULL; request_info.current_user_length = 0; - request_info.filename = r->filename; - SG(request_info).request_method = r->method; - SG(request_info).content_type = table_get(r->subprocess_env, "CONTENT_TYPE"); - - buf = table_get(r->subprocess_env, "CONTENT_LENGTH"); - SG(request_info).content_length = (buf ? atoi(buf) : 0); return SUCCESS; } Index: php4/snprintf.c diff -u php4/snprintf.c:1.1.1.1 php4/snprintf.c:1.2 --- php4/snprintf.c:1.1.1.1 Wed Apr 7 17:02:47 1999 +++ php4/snprintf.c Mon May 10 20:01:41 1999 @@ -53,7 +53,7 @@ * <panos@alumni.cs.colorado.edu> for xinetd. */ -#include "config.h" +#include "php_config.h" #if !defined(APACHE) || (!APACHE) #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) -- PHP 4 Beta

« previous php.version4 (#749) next »