* 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
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
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
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
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.
])
-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,
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
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
+#include "php_regex.h"
#include "reg.h"
unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
--- /dev/null
+#ifndef _PHP_REGEX_H
+#define _PHP_REGEX_H
+
+#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
+
+#endif /* _PHP_REGEX_H */
\ No newline at end of file
#if (WIN32|WINNT)
#define HAVE_LIBTTF 1
#else
-#include "config.h"
+#include "php_config.h"
#endif
#if HAVE_LIBTTF
#if WIN32|WINNT
#include "config.w32.h"
#else
-#include "config.h"
+#include "php_config.h"
#endif
#if HAVE_LIBTTF
#include <stdio.h>
* -----------------
*
* $Log$
+* Revision 1.1 1999/04/21 23:11:20 ssb
+* moved apache, com and hyperwave into ext/
+*
* Revision 1.1.1.1 1999/04/07 21:03:31 zeev
* PHP 4.0
*
****************************************************************************/
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#if HYPERWAVE
#if WIN32|WINNT
#include "win95nt.h"
#else
-#include "config.h"
+#include "php_config.h"
#endif
#if HYPERWAVE
#include <stdlib.h>
#if !(WIN32|WINNT)
-#include "config.h"
+#include "php_config.h"
#endif
#include "php.h"
#include "ext/standard/head.h"
/* TODO: A lot... */
-#include "config.h"
+#include "php_config.h"
#include "php.h"
#include "php3_interbase.h"
#if HAVE_UODBC
# if !(WIN32|WINNT)
-# include "config.h"
+# include "php_config.h"
# include "build-defs.h"
# endif
#include <stdlib.h>
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#include "php.h"
#include "php3_pgsql.h"
#include "php.h"
#include "php3_browscap.h"
#include "php_ini.h"
+#include "php_regex.h"
#include "zend_globals.h"
{
char *res = NULL, *var, *val;
pval *array_ptr;
- int free_buffer;
+ int free_buffer=0;
ELS_FETCH();
PLS_FETCH();
SLS_FETCH();
#include <stdio.h>
#include "php.h"
#include "php3_string.h"
+#include "php_regex.h"
#include "reg.h"
unsigned char third_argument_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
#include <ctype.h>
#include <sys/types.h>
-/* php.h includes the correct regex.h */
#include "php.h"
+#include "php_regex.h"
#include "url.h"
#ifdef _OSD_POSIX
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#include "php.h"
#include "php3_sybase-ct.h"
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#include "php.h"
#include "php3_sybase.h"
*/
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#if HAVE_SYSVSEM
*/
#ifndef MSVC5
-#include "config.h"
+#include "php_config.h"
#endif
#! /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"
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
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
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
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;
}
/* 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
#endif
SLS_FETCH();
- SG(server_context) = r;
-
if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
return FAILURE;
}
# define PHPAPI __declspec(dllimport)
# endif
#else
-#include "config.h"
+#include "php_config.h"
#define PHPAPI
#define THREAD_LS
#endif
#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>
#else
--- /dev/null
+#ifndef _PHP_REGEX_H
+#define _PHP_REGEX_H
+
+#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
+
+#endif /* _PHP_REGEX_H */
\ No newline at end of file
* <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)
+----------------------------------------------------------------------+
| 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$ */
#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"
# 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
}
-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");
}
*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 {
}
-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;
}
+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) {
/* 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();
/* $Id$ */
-#include "config.h"
+#include "php_config.h"
#include <stdio.h>
#include <stdarg.h>
#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;
}