Remove mostly all references to APACHE and CGI_BINARY from the code.
- Apache include files are no longer included by any PHP code, except for the Apache SAPI module.
- No server specific code is in any of the base PHP code.
Still left to be done:
- Eliminate any references to APACHE from the few remaining modules.
- Move request_info.c's logic to SAPI
- Modify the regex function names, and globals, so that we can always
include them, without having to fear any interference with Apache;
Always use the bundled regex library
/* Define if you have the sendmail program available */
#define HAVE_SENDMAIL 0
-/* Define if you are compiling PHP as an Apache module */
-#define APACHE 0
-
/* Define if you are compiling PHP as an Apache module with mod_charset patch applied (aka Russian Apache)*/
#define USE_TRANSFER_TABLES 0
PHP_FAST_OUTPUT(regex/Makefile)
elif test "$REGEX_TYPE" = "system"; then
AC_DEFINE(REGEX,0)
-elif test "$REGEX_TYPE" = "apache"; then
- AC_DEFINE(REGEX,2)
fi
AC_MSG_CHECKING(which regex library to use)
#if HAVE_ASPELL
#include "php_aspell.h"
-#if APACHE
-# ifndef DEBUG
-# undef palloc
-# endif
-#endif
#include <aspell-c.h>
function_entry aspell_functions[] = {
#if NFS_HACK
while((last_try = stat(lockfn,&sb))==0) {
retries++;
- sleep(1);
+ php_sleep(1);
if (retries>30) break;
}
if (last_try!=0) {
* REGEX means:
* 0.. system regex
* 1.. bundled regex
- * 2.. Apache's regex
*/
-#if REGEX == 1
+#if REGEX
/* get aliases */
#include "regex/regex_extra.h"
#include "regex/regex.h"
if ( (errno == EAGAIN) || (errno == EWOULDBLOCK) ) {
if ( ++try > 5 )
return(-1);
- sleep(1);
+ php_sleep(1);
}
else return(-1);
}
if ( (errno == EAGAIN) || (errno == EWOULDBLOCK) ) {
if ( ++try > 5 )
return(-1);
- sleep(1);
+ php_sleep(1);
}
else return(-1);
}
DLEXPORT zend_module_entry *get_module(void) { return &mysql_module_entry; }
#endif
-#if APACHE
-void timeout(int sig);
-#endif
#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"MySQL: A link to the server could not be established"); RETURN_FALSE; } }
static void _close_mysql_link(MYSQL *link)
{
-#if APACHE
- void (*handler) (int);
-#endif
MySLS_FETCH();
-#if APACHE
- handler = signal(SIGPIPE, SIG_IGN);
-#endif
-
mysql_close(link);
-
-#if APACHE
- signal(SIGPIPE,handler);
-#endif
-
efree(link);
MySG(num_links)--;
}
static void _close_mysql_plink(MYSQL *link)
{
-#if APACHE
- void (*handler) (int);
-#endif
MySLS_FETCH();
-#if APACHE
- handler = signal(SIGPIPE, SIG_IGN);
-#endif
-
mysql_close(link);
-#if APACHE
- signal(SIGPIPE,handler);
-#endif
-
free(link);
MySG(num_persistent)--;
MySG(num_links)--;
static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{
-#if APACHE
- void (*handler) (int);
-#endif
char *user,*passwd,*host,*socket=NULL,*tmp;
char *hashed_details;
int hashed_details_length,port = MYSQL_PORT;
RETURN_FALSE;
}
/* ensure that the link did not die */
-#if APACHE
- handler=signal(SIGPIPE,SIG_IGN);
-#endif
#if defined(HAVE_MYSQL_ERRNO) && defined(CR_SERVER_GONE_ERROR)
mysql_stat(le->ptr);
if (mysql_errno((MYSQL *)le->ptr) == CR_SERVER_GONE_ERROR) {
#else
if (!strcasecmp(mysql_stat(le->ptr),"mysql server has gone away")) { /* the link died */
#endif
-#if APACHE
- signal(SIGPIPE,handler);
-#endif
#if MYSQL_VERSION_ID > 32199 /* this lets us set the port number */
if (mysql_real_connect(le->ptr,host,user,passwd,NULL,port,socket,0)==NULL) {
#else
RETURN_FALSE;
}
}
-#if APACHE
- signal(SIGPIPE,handler);
-#endif
mysql = (MYSQL *) le->ptr;
}
ZEND_REGISTER_RESOURCE(return_value, mysql, le_plink);
case OCI_FO_ERROR:
{
printf(" Failover error gotten. Sleeping...\n");
- sleep(3);
+ php_sleep(3);
/* cannot find this blody define !!! return OCI_FO_RETRY; */
break;
}
DLEXPORT zend_module_entry *get_module(void) { return &posix__module_entry; }
#endif
-#if APACHE
-void timeout(int sig);
-#endif
-
static PHP_MINFO_FUNCTION(posix)
{
PUTS("$Revision$\n");
WRONG_PARAM_COUNT;
}
convert_to_long_ex(num);
- sleep((*num)->value.lval);
+ php_sleep((*num)->value.lval);
}
PHP_FUNCTION(usleep)
*/
#include "php.h"
+#include "php_regex.h"
#include "php_browscap.h"
#include "php_ini.h"
}
/* load dynamic symbol */
- handle = dlopen(libpath, RTLD_LAZY);
+ handle = DL_LOAD(libpath);
if (!handle) {
int error_type;
#endif
RETURN_FALSE;
}
- get_module = (zend_module_entry *(*)(void)) dlsym(handle, "get_module");
+ get_module = (zend_module_entry *(*)(void)) DL_FETCH_SYMBOL(handle, "get_module");
if (!get_module) {
- dlclose(handle);
+ DL_UNLOAD(handle);
php_error(E_CORE_WARNING,"Invalid library (maybe not a PHP library) '%s' ",file->value.str.val);
RETURN_FALSE;
}
if (module_entry->module_startup_func) {
if (module_entry->module_startup_func(type, module_entry->module_number ELS_CC)==FAILURE) {
php_error(E_CORE_WARNING,"%s: Unable to initialize module",module_entry->name);
- dlclose(handle);
+ DL_UNLOAD(handle);
RETURN_FALSE;
}
}
if (module_entry->request_startup_func) {
if (module_entry->request_startup_func(type, module_entry->module_number ELS_CC)) {
php_error(E_CORE_WARNING,"%s: Unable to initialize module",module_entry->name);
- dlclose(handle);
+ DL_UNLOAD(handle);
RETURN_FALSE;
}
}
if (type == 1) {
-#if APACHE
- SLS_FETCH();
-#endif
-
if (output) PUTS(buf);
-#if APACHE
-# if MODULE_MAGIC_NUMBER > 19970110
- if (output) rflush(((request_rec *) SG(server_context)));
-# else
- if (output) bflush(((request_rec *) SG(server_context))->connection->client);
-# endif
-#endif
-#if CGI_BINARY
- fflush(stdout);
-#endif
-#if FHTTPD
- /* fhttpd doesn't flush */
-#endif
-#if USE_SAPI
- sapi_rqst->flush(sapi_rqst->scid);
-#endif
+ sapi_flush();
}
else if (type == 2) {
/* strip trailing whitespaces */
}
-#if 0
-/* Adds header information */
-void php4i_add_header_information(char *header_information, uint header_length)
-{
- char *r;
-#if APACHE
- char *rr = NULL;
- char *temp = NULL;
- long myuid = 0L;
- char temp2[32];
- request_rec *req;
- SLS_FETCH();
-
- req = ((request_rec *) SG(server_context));
-#endif
-
- if (php_header_printed == 1) {
-#if DEBUG
- php_error(E_WARNING, "Cannot add more header information - the header was already sent "
- "(header information may be added only before any output is generated from the script - "
- "check for text or whitespace outside PHP tags, or calls to functions that output text)");
-#endif
- return; /* too late, already sent */
- }
-#if APACHE
- /*
- * Not entirely sure this is the right way to support the header
- * command in the Apache module. Comments?
- */
- r = strchr(header_information, ':');
- if (r) {
- *r = '\0';
- if (!strcasecmp(header_information, "Content-type")) {
- if (*(r + 1) == ' ')
- req->content_type = pstrdup(req->pool,r + 2);
- else
- req->content_type = pstrdup(req->pool,r + 1);
- cont_type = (char *) req->content_type;
- } else {
- if (*(r + 1) == ' ') {
- rr = r + 2;
- } else {
- rr = r + 1;
- }
- if (PG(safe_mode) && (!strcasecmp(header_information, "WWW-authenticate"))) {
- myuid = php_getuid();
- sprintf(temp2, "realm=\"%ld ", myuid); /* SAFE */
- temp = php_reg_replace("realm=\"", temp2, rr, 1, 0);
- if (!strcmp(temp, rr)) {
- sprintf(temp2, "realm=%ld", myuid); /* SAFE */
- temp = php_reg_replace("realm=", temp2, rr, 1, 0);
- if (!strcmp(temp, rr)) {
- sprintf(temp2, " realm=%ld", myuid); /* SAFE */
- temp = php_reg_replace("$", temp2, rr, 0, 0);
- }
- }
- table_set(req->headers_out, header_information, temp);
- } else
- table_set(req->headers_out, header_information, rr);
- }
- if (!strcasecmp(header_information, "location")) {
- req->status = REDIRECT;
- }
- *r = ':';
- php_header_printed = 2;
- }
- if (!strncasecmp(header_information, "http/", 5)) {
- if (strlen(header_information) > 9) {
- req->status = atoi(&((header_information)[9]));
- }
- /* Use a pstrdup here to get the memory straight from Apache's per-request pool to
- * avoid having our own memory manager complain about this memory not being freed
- * because it really shouldn't be freed until the end of the request and it isn't
- * easy for us to figure out when we allocated it vs. when something else might have.
- */
- req->status_line = pstrdup(req->pool,&((header_information)[9]));
- }
-#else
- r = strchr(header_information, ':');
- if (r) {
- *r = '\0';
- if (!strcasecmp(header_information, "Content-type")) {
- if (cont_type) efree(cont_type);
- cont_type = estrdup(r + 1);
-#if 0 /*WIN32|WINNT / *M$ does us again*/
- if (!strcmp(cont_type," text/html")){
- *r=':';
- PUTS_H(header_information);
- PUTS_H("\015\012");
- }
-#endif
- } else {
- *r = ':';
-#if USE_SAPI
- {
- char *tempstr=emalloc(strlen(header_information)+2);
-
- sprintf(tempstr,"%s\015\012",tempstr);
- sapi_rqst->header(sapi_rqst->scid,tempstr);
- efree(tempstr);
- }
-#else
- PUTS_H(header_information);
- PUTS_H("\015\012");
-#endif
- }
- } else {
-#if USE_SAPI
- {
- char *tempstr=emalloc(strlen(header_information)+2);
- sprintf(tempstr,"%s\015\012",tempstr);
- sapi_rqst->header(sapi_rqst->scid,tempstr);
- efree(tempstr);
- }
-#else
- PUTS_H(header_information);
- PUTS_H("\015\012");
-#endif
- }
-#endif
-}
-#else
void php4i_add_header_information(char *header_information, uint header_length)
{
sapi_add_header(header_information, header_length);
}
-#endif
/* Implementation of the language Header() function */
#include "php_mail.h"
#include "php_ini.h"
-#if APACHE
-# ifndef DEBUG
-# undef palloc
-# endif
-#endif
-
#if HAVE_SENDMAIL
#if MSVC5
#include "win32/sendmail.h"
PHP_FUNCTION(str_repeat);
PHP_FUNCTION(substr_replace);
-extern PHPAPI char *php_strtoupper(char *s, size_t len);
-extern PHPAPI char *php_strtolower(char *s, size_t len);
-extern PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
-extern PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit);
-extern PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength);
-extern PHPAPI void php_stripslashes(char *str, int *len);
-extern PHPAPI void php_stripcslashes(char *str, int *len);
-extern PHPAPI void php_dirname(char *str, int len);
-extern PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
-extern PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
+PHPAPI char *php_strtoupper(char *s, size_t len);
+PHPAPI char *php_strtolower(char *s, size_t len);
+PHPAPI char *php_strtr(char *str, int len, char *str_from, char *str_to, int trlen);
+PHPAPI char *php_addslashes(char *str, int length, int *new_length, int freeit);
+PHPAPI char *php_addcslashes(char *str, int length, int *new_length, int freeit, char *what, int wlength);
+PHPAPI void php_stripslashes(char *str, int *len);
+PHPAPI void php_stripcslashes(char *str, int *len);
+PHPAPI void php_dirname(char *str, int len);
+PHPAPI char *php_stristr(unsigned char *s, unsigned char *t, size_t s_len, size_t t_len);
+PHPAPI char *php_str_to_str(char *haystack, int length, char *needle,
int needle_len, char *str, int str_len, int *_new_length);
-extern PHPAPI void php_trim(pval *str, pval *return_value, int mode);
-extern PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allow_len);
+PHPAPI void php_trim(pval *str, pval *return_value, int mode);
+PHPAPI void php_strip_tags(char *rbuf, int len, int state, char *allow, int allow_len);
-extern PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result);
+PHPAPI void php_char_to_str(char *str, uint len, char from, char *to, int to_len, pval *result);
-extern PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value);
-extern PHPAPI void php_explode(pval *delim, pval *str, pval *return_value);
-extern PHPAPI inline char *php_memnstr(char *haystack, char *needle, int needle_len, char *end);
-extern PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
-extern PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
+PHPAPI void php_implode(pval *delim, pval *arr, pval *return_value);
+PHPAPI void php_explode(pval *delim, pval *str, pval *return_value);
+PHPAPI inline char *php_memnstr(char *haystack, char *needle, int needle_len, char *end);
+PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end);
+PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end);
+
+#ifndef HAVE_STRERROR
+PHPAPI char *php_strerror(int errnum);
+#define strerror php_strerror
+#endif
#endif /* _PHPSTRING_H */
/* }}} */
#ifndef HAVE_STRERROR
-#if !APACHE
-char *strerror(int errnum)
+char *php_strerror(int errnum)
{
extern int sys_nerr;
extern char *sys_errlist[];
return(BG(str_ebuf));
}
#endif
-#endif
PHPAPI void php_stripcslashes(char *str, int *len)
{
#include "url.h"
#ifdef _OSD_POSIX
#ifndef APACHE
-#error On this EBCDIC platform, PHP3 is only supported as an Apache module.
+#error On this EBCDIC platform, PHP is only supported as an Apache module.
#else /*APACHE*/
#ifndef CHARSET_EBCDIC
#define CHARSET_EBCDIC /* this machine uses EBCDIC, not ASCII! */
will move to the "don't touch" list below eventualy.
---------------------------------------------------------------*/
-/*#define APACHE 0 defined in preprocessor section*/
-
/* ----------------------------------------------------------------
The following should never need to be played with
}
}
-#if CGI_BINARY || FHTTPD || USE_SAPI
PHPAPI FILE *php_fopen_primary_script(void)
{
return fp;
}
-#endif /* CGI_BINARY || USE_SAPI */
/*
* Tries to open a file with a PATH-style list of directories.
extern int php_init_mime(INIT_FUNC_ARGS);
-#if 0
-#if APACHE
-extern zend_module_entry apache_module_entry;
-#define phpext_apache_ptr &apache_module_entry
-extern void php_virtual(INTERNAL_FUNCTION_PARAMETERS);
-#else
-#define phpext_apache_ptr NULL
-#endif
-#endif
-
/* environment functions */
extern int php_init_environment(void);
#define YYDEBUG 0
-#define CGI_BINARY (!APACHE && !USE_SAPI && !FHTTPD)
-
#include "php_version.h"
#include "zend.h"
#define inline
#endif
+#define APACHE 0
+#define CGI_BINARY 0
#if HAVE_UNIX_H
#include <unix.h>
#include "request_info.h"
-#if HAVE_LIBDL
-# if MSVC5
-# include <windows.h>
-# define dlclose FreeLibrary
-# define dlopen(a,b) LoadLibrary(a)
-# define dlsym GetProcAddress
-# else
-#if HAVE_DLFCN_H && !((defined(_AIX) || defined(AIX)) && APACHE)
-# include <dlfcn.h>
-#endif
-# endif
-#endif
-
#define CREATE_MUTEX(a,b)
#define SET_MUTEX(a)
#define FREE_MUTEX(a)
#include "fopen-wrappers.h"
-#if APACHE /* apache httpd */
-# if HAVE_AP_CONFIG_H
-#include "ap_config_auto.h"
-#ifdef RHAPSODY
-#undef HAVE_SNPRINTF
-#endif
-#include "ap_config.h"
-#ifdef RHAPSODY
-#undef HAVE_SNPRINTF
-#define HAVE_SNPRINTF 1
-#endif
-# endif
-# if HAVE_OLD_COMPAT_H
-#include "compat.h"
-# endif
-# if HAVE_AP_COMPAT_H
-#include "ap_compat.h"
-# endif
-#include "httpd.h"
-#include "http_main.h"
-#include "http_core.h"
-#include "http_request.h"
-#include "http_protocol.h"
-#include "http_config.h"
-#include "http_log.h"
-#define BLOCK_INTERRUPTIONS block_alarms
-#define UNBLOCK_INTERRUPTIONS unblock_alarms
-#endif
-
#if REGEX == 1 || REGEX == 0
#include "regex/regex_extra.h"
#endif
#include <sys/param.h>
# endif
#endif
-#if CGI_BINARY /* CGI version */
-#define BLOCK_INTERRUPTIONS NULL
-#define UNBLOCK_INTERRUPTIONS NULL
-#endif
#if HAVE_LIMITS_H
#include <limits.h>
extern pval *data;
#if !(PHP_WIN32)
extern char **environ;
+#define php_sleep sleep
#endif
extern void phperror(char *error);
* REGEX means:
* 0.. system regex
* 1.. bundled regex
- * 2.. Apache's regex
*/
-#if REGEX == 1
+#if REGEX
/* get aliases */
#include "regex/regex_extra.h"
#include "regex/regex.h"
#include "php.h"
-#if !defined(APACHE) || (!APACHE)
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
#include <stdio.h>
#ifdef HAVE_GCVT
-#define ap_ecvt ecvt
-#define ap_fcvt fcvt
-#define ap_gcvt gcvt
+#define ap_php_ecvt ecvt
+#define ap_php_fcvt fcvt
+#define ap_php_gcvt gcvt
#else
*/
/*
- * ap_ecvt converts to decimal
+ * ap_php_ecvt converts to decimal
* the number of digits is specified by ndigit
* decpt is set to the position of the decimal point
* sign is set to 0 for positive, 1 for negative
#define NDIG 80
static char *
- ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)
+ ap_php_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)
{
register int r2;
double fi, fj;
}
static char *
- ap_ecvt(double arg, int ndigits, int *decpt, int *sign)
+ ap_php_ecvt(double arg, int ndigits, int *decpt, int *sign)
{
- return (ap_cvt(arg, ndigits, decpt, sign, 1));
+ return (ap_php_cvt(arg, ndigits, decpt, sign, 1));
}
static char *
- ap_fcvt(double arg, int ndigits, int *decpt, int *sign)
+ ap_php_fcvt(double arg, int ndigits, int *decpt, int *sign)
{
- return (ap_cvt(arg, ndigits, decpt, sign, 0));
+ return (ap_php_cvt(arg, ndigits, decpt, sign, 0));
}
/*
- * ap_gcvt - Floating output conversion to
+ * ap_php_gcvt - Floating output conversion to
* minimal length string
*/
static char *
- ap_gcvt(double number, int ndigit, char *buf)
+ ap_php_gcvt(double number, int ndigit, char *buf)
{
int sign, decpt;
register char *p1, *p2;
register i;
- p1 = ap_ecvt(number, ndigit, &decpt, &sign);
+ p1 = ap_php_ecvt(number, ndigit, &decpt, &sign);
p2 = buf;
if (sign)
*p2++ = '-';
int decimal_point;
if (format == 'f')
- p = ap_fcvt(num, precision, &decimal_point, is_negative);
+ p = ap_php_fcvt(num, precision, &decimal_point, is_negative);
else /* either e or E format */
- p = ap_ecvt(num, precision + 1, &decimal_point, is_negative);
+ p = ap_php_ecvt(num, precision + 1, &decimal_point, is_negative);
/*
* Check for Infinity and NaN
/*
* * We use &num_buf[ 1 ], so that we have room for the sign
*/
- s = ap_gcvt(va_arg(ap, double), precision, &num_buf[1]);
+ s = ap_php_gcvt(va_arg(ap, double), precision, &num_buf[1]);
if (*s == '-')
prefix_char = *s++;
else if (print_sign)
}
-int ap_snprintf(char *buf, size_t len, const char *format,...)
+int ap_php_snprintf(char *buf, size_t len, const char *format,...)
{
int cc;
va_list ap;
}
-int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
+int ap_php_vsnprintf(char *buf, size_t len, const char *format, va_list ap)
{
int cc;
}
#endif /* HAVE_SNPRINTF */
-#endif /* APACHE */
+----------------------------------------------------------------------+
*/
-#ifndef _PHP3_SNPRINTF_H
-#define _PHP3_SNPRINTF_H
+#ifndef _PHP_SNPRINTF_H
+#define _PHP_SNPRINTF_H
#ifndef HAVE_SNPRINTF
-extern int ap_snprintf(char *, size_t, const char *, ...);
-#define snprintf ap_snprintf
+extern int ap_php_snprintf(char *, size_t, const char *, ...);
+#define snprintf ap_php_snprintf
#endif
#ifndef HAVE_VSNPRINTF
-extern int ap_vsnprintf(char *, size_t, const char *, va_list ap);
-#define vsnprintf ap_vsnprintf
+extern int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
+#define vsnprintf ap_php_vsnprintf
#endif
#if BROKEN_SPRINTF
#define php_sprintf sprintf
#endif
-#endif /* _PHP3_SNPRINTF_H */
+#endif /* _PHP_SNPRINTF_H */
/*
* Local variables:
#define mkdir(a,b) _mkdir(a)
#define rmdir _rmdir
#define getpid _getpid
-#if !(APACHE)
-#define sleep(t) Sleep(t*1000)
-#endif
+#define php_sleep(t) Sleep(t*1000)
#define getcwd _getcwd
#define snprintf _snprintf
#define off_t _off_t
#if CGI_BINARY
int php_init_request_info(void *conf)
{
- request_info.current_user = NULL;
- request_info.current_user_length = 0;
request_info.script_name = getenv("SCRIPT_NAME");
request_info.script_filename = getenv("SCRIPT_FILENAME");
/* Hack for annoying servers that do not set SCRIPT_FILENAME for us */
SLS_FETCH();
r = ((request_rec *) SG(server_context));
- request_info.current_user = NULL;
- request_info.current_user_length = 0;
return SUCCESS;
}
return SUCCESS;
}
#endif
-/*
- * Local variables:
+
+
+int php_init_request_info(void *conf)
+{
+ request_info.current_user = NULL;
+ request_info.current_user_length = 0;
+ return SUCCESS;
+}
+
+
+
+/* * Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
#define _REQUEST_INFO_H_
typedef struct {
- char *script_name;
char *current_user;
int current_user_length;
const char *script_filename;
PHP_APXS_BROKEN=yes
fi
STRONGHOLD=
- AC_DEFINE(APACHE)
AC_DEFINE(HAVE_AP_CONFIG_H)
AC_DEFINE(HAVE_AP_COMPAT_H)
AC_MSG_RESULT(yes)
PHP_SAPI=apache
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_INSTALL_FILES $APACHE_TARGET"
PHP_LIBS="-L. -lphp3"
- AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 1.2.x)
STRONGHOLD=
if test -f $withval/src/ap_config.h; then
PHP_SAPI=apache
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
- AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 2.0.X)
STRONGHOLD=
if test -f $withval/src/include/ap_config.h; then
PHP_SAPI=apache
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
- AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 1.3.x)
STRONGHOLD=
if test -f $withval/src/include/ap_config.h; then
PHP_SAPI=apache
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET; cp $srcdir/sapi/apache/apMakefile.tmpl $APACHE_TARGET/Makefile.tmpl; cp $srcdir/sapi/apache/apMakefile.libdir $APACHE_TARGET/Makefile.libdir"
- AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - Apache 1.3.x)
STRONGHOLD=
if test -f $withval/src/include/ap_config.h; then
PHP_LIBS="-Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4"
APACHE_INSTALL="mkdir -p $APACHE_TARGET; cp $SAPI_STATIC $APACHE_TARGET/libmodphp4.a; cp $APACHE_INSTALL_FILES $APACHE_TARGET"
STRONGHOLD=-DSTRONGHOLD=1
- AC_DEFINE(APACHE)
AC_MSG_RESULT(yes - StrongHold)
if test -f $withval/apache/ap_config.h; then
AC_DEFINE(HAVE_AP_CONFIG_H)
#include "zend.h"
#include "php.h"
#include "php_variables.h"
+#include "SAPI.h"
#include "httpd.h"
#include "http_config.h"
block_alarms();
register_cleanup(((request_rec *) SG(server_context))->pool, NULL, php_request_shutdown, php_request_shutdown_for_exec);
unblock_alarms();
+ return SUCCESS;
}
static char *php_apache_getenv(char *name, int name_len SLS_DC)
{
- char *value;
-
- return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name));
+ return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
#include <errno.h>
#include <ctype.h>
-#if APACHE
+#include "remains.h"
#include "http_request.h"
#include "build-defs.h"
}
#endif
-#endif
-
/*
* Local variables:
* tab-width: 4
--- /dev/null
+# if HAVE_AP_CONFIG_H
+#include "ap_config_auto.h"
+#ifdef RHAPSODY
+#undef HAVE_SNPRINTF
+#endif
+#include "ap_config.h"
+#ifdef RHAPSODY
+#undef HAVE_SNPRINTF
+#define HAVE_SNPRINTF 1
+#endif
+# endif
+# if HAVE_OLD_COMPAT_H
+#include "compat.h"
+# endif
+# if HAVE_AP_COMPAT_H
+#include "ap_compat.h"
+# endif
+#include "httpd.h"
+#include "http_main.h"
+#include "http_core.h"
+#include "http_request.h"
+#include "http_protocol.h"
+#include "http_config.h"
+#include "http_log.h"
#include "SAPI.h"
-#if CGI_BINARY
-
#include <stdio.h>
#include "php.h"
#ifdef MSVC5
char *val;
int l=0;
- sn = request_info.script_name;
+ sn = getenv("SCRIPT_NAME");
pi = SG(request_info).request_uri;
if (sn)
l += strlen(sn);
return SUCCESS;
}
-
-#endif