summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/aolserver/aolserver.c6
-rw-r--r--sapi/apache/mod_php5.c30
-rw-r--r--sapi/apache2filter/apache_config.c4
-rw-r--r--sapi/apache2filter/php_apache.h6
-rw-r--r--sapi/apache2filter/sapi_apache2.c28
-rw-r--r--sapi/apache2handler/apache_config.c4
-rw-r--r--sapi/apache2handler/sapi_apache2.c21
-rw-r--r--sapi/apache_hooks/mod_php5.c8
-rw-r--r--sapi/caudium/caudium.c8
-rw-r--r--sapi/cgi/cgi_main.c11
-rw-r--r--sapi/cgi/config9.m44
-rw-r--r--sapi/cli/config.m49
-rw-r--r--sapi/cli/php.1.in4
-rw-r--r--sapi/isapi/php5isapi.c25
-rw-r--r--sapi/nsapi/nsapi.c6
-rw-r--r--sapi/pi3web/pi3web_sapi.c8
16 files changed, 95 insertions, 87 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c
index 36b719dd6..7ea0a7e96 100644
--- a/sapi/aolserver/aolserver.c
+++ b/sapi/aolserver/aolserver.c
@@ -22,7 +22,7 @@
* - CGI/1.1 conformance
*/
-/* $Id: aolserver.c,v 1.77 2004/01/08 08:18:02 andi Exp $ */
+/* $Id: aolserver.c,v 1.77.2.1 2005/07/04 12:47:26 dmitry Exp $ */
/* conflict between PHP and AOLserver headers */
#define Debug php_Debug
@@ -205,7 +205,7 @@ static void php_info_aolserver(ZEND_MODULE_INFO_FUNC_ARGS)
int i;
php_info_print_table_start();
- php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.77 2004/01/08 08:18:02 andi Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: aolserver.c,v 1.77.2.1 2005/07/04 12:47:26 dmitry Exp $");
php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -549,7 +549,7 @@ php_ns_config(php_ns_context *ctx, char global)
Ns_Log(Debug, "PHP configuration option '%s=%s'", new_key, val);
zend_alter_ini_entry(new_key, strlen(new_key) + 1, val,
- strlen(val) + 1, PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
+ strlen(val) + 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
efree(new_key);
}
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 6d48dc2d1..a581b6654 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.10 2004/07/14 09:43:26 sesser Exp $ */
+/* $Id: mod_php5.c,v 1.10.2.4 2005/08/01 08:12:42 dmitry Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -199,9 +199,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
*p = ':'; /* a well behaved header handler shouldn't change its original arguments */
- efree(sapi_header->header);
-
- return 0; /* don't use the default SAPI mechanism, Apache duplicates this functionality */
+ return SAPI_HEADER_ADD;
}
/* }}} */
@@ -209,14 +207,20 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
*/
static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
- if(SG(server_context) == NULL) { /* server_context is not here anymore */
+ request_rec *r = SG(server_context);
+
+ if(r == NULL) { /* server_context is not here anymore */
return SAPI_HEADER_SEND_FAILED;
}
- ((request_rec *) SG(server_context))->status = SG(sapi_headers).http_response_code;
- send_http_header((request_rec *) SG(server_context));
+ r->status = SG(sapi_headers).http_response_code;
+ if(r->status==304) {
+ send_error_response(r,0);
+ } else {
+ send_http_header(r);
+ }
return SAPI_HEADER_SENT_SUCCESSFULLY;
-}
+}
/* }}} */
/* {{{ sapi_apache_register_server_variables
@@ -348,6 +352,10 @@ static struct stat *php_apache_get_stat(TSRMLS_D)
*/
static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
{
+ if (SG(server_context) == NULL) {
+ return NULL;
+ }
+
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
/* }}} */
@@ -686,11 +694,11 @@ static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry)
/* {{{ should_overwrite_per_dir_entry
*/
-static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *orig_per_dir_entry, zend_hash_key *hash_key, void *pData)
+static zend_bool should_overwrite_per_dir_entry(HashTable *target_ht, php_per_dir_entry *new_per_dir_entry, zend_hash_key *hash_key, void *pData)
{
- php_per_dir_entry *new_per_dir_entry;
+ php_per_dir_entry *orig_per_dir_entry;
- if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &new_per_dir_entry)==FAILURE) {
+ if (zend_hash_find(target_ht, hash_key->arKey, hash_key->nKeyLength, (void **) &orig_per_dir_entry)==FAILURE) {
return 1; /* does not exist in dest, copy from source */
}
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c
index 56aeb44db..b0f5f76bc 100644
--- a/sapi/apache2filter/apache_config.c
+++ b/sapi/apache2filter/apache_config.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apache_config.c,v 1.32 2004/01/08 08:18:04 andi Exp $ */
+/* $Id: apache_config.c,v 1.32.2.1 2005/07/04 12:47:26 dmitry Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -178,7 +178,7 @@ void apply_config(void *dummy)
zend_hash_get_current_data(&d->config, (void **) &data);
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
if (zend_alter_ini_entry(str, str_len, data->value, data->value_len,
- data->status, PHP_INI_STAGE_RUNTIME) == FAILURE) {
+ data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
}
diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h
index e0c0cf62a..38cd20e55 100644
--- a/sapi/apache2filter/php_apache.h
+++ b/sapi/apache2filter/php_apache.h
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.h,v 1.23 2004/01/08 17:33:17 sniper Exp $ */
+/* $Id: php_apache.h,v 1.23.2.1 2005/07/16 12:30:10 hyanantha Exp $ */
#ifndef PHP_APACHE_H
#define PHP_APACHE_H
@@ -41,11 +41,7 @@ typedef struct php_struct {
/* Index for reading from buffer */
int post_idx;
/* stat structure of the current file */
-#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
- struct stat_libc finfo;
-#else
struct stat finfo;
-#endif
/* Buffer for request body filter */
char *post_data;
/* Whether or not we've processed PHP in the output filters yet. */
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 4068a276e..320cae744 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.125.2.1 2005/01/07 06:28:24 sniper Exp $ */
+/* $Id: sapi_apache2.c,v 1.125.2.5 2005/07/16 12:30:10 hyanantha Exp $ */
#include <fcntl.h>
@@ -128,9 +128,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_headers_str
else
apr_table_add(ctx->r->headers_out, sapi_header->header, val);
- sapi_free_header(sapi_header);
-
- return 0;
+ return SAPI_HEADER_ADD;
}
static int
@@ -173,7 +171,7 @@ php_apache_sapi_get_stat(TSRMLS_D)
ctx->finfo.st_gid = ctx->r->finfo.group;
ctx->finfo.st_dev = ctx->r->finfo.device;
ctx->finfo.st_ino = ctx->r->finfo.inode;
-#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+#ifdef NETWARE
ctx->finfo.st_atime.tv_sec = ctx->r->finfo.atime/1000000;
ctx->finfo.st_mtime.tv_sec = ctx->r->finfo.mtime/1000000;
ctx->finfo.st_ctime.tv_sec = ctx->r->finfo.ctime/1000000;
@@ -272,18 +270,10 @@ static void php_apache_sapi_log_message(char *msg)
ctx = SG(server_context);
- /* We use APLOG_STARTUP because it keeps us from printing the
- * data and time information at the beginning of the error log
- * line. Not sure if this is correct, but it mirrors what happens
- * with Apache 1.3 -- rbb
- */
if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
- ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
- 0, NULL, "%s", msg);
- }
- else {
- ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO | APLOG_STARTUP,
- 0, ctx->r->server, "%s", msg);
+ ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg);
+ } else {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, ctx->r->server, "%s", msg);
}
}
@@ -356,7 +346,7 @@ static int php_input_filter(ap_filter_t *f, apr_bucket_brigade *bb,
ctx = SG(server_context);
if (ctx == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
"php failed to get server context");
return HTTP_INTERNAL_SERVER_ERROR;
}
@@ -467,7 +457,7 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
ctx = SG(server_context);
if (ctx == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, f->r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, f->r,
"php failed to get server context");
zend_try {
zend_ini_deactivate(TSRMLS_C);
@@ -636,7 +626,7 @@ static void php_add_filter(request_rec *r, ap_filter_t *f)
/* for those who still have Set*Filter PHP configured */
while (f) {
if (strcmp(f->frec->name, "PHP") == 0) {
- ap_log_error(APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO,
+ ap_log_error(APLOG_MARK, APLOG_WARNING,
0, r->server,
"\"Set%sFilter PHP\" already configured for %s",
output ? "Output" : "Input", r->uri);
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index a863d0730..505104718 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: apache_config.c,v 1.5 2004/01/08 08:18:05 andi Exp $ */
+/* $Id: apache_config.c,v 1.5.2.1 2005/07/04 12:47:26 dmitry Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -166,7 +166,7 @@ void apply_config(void *dummy)
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
- if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_RUNTIME) == FAILURE) {
+ if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_ACTIVATE) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
}
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 7a3721aaa..707e73c53 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.40.2.7 2005/03/10 11:23:57 jorton Exp $ */
+/* $Id: sapi_apache2.c,v 1.40.2.11 2005/09/02 13:51:26 sniper Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -112,9 +112,7 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header,sapi_headers_stru
apr_table_add(ctx->r->headers_out, sapi_header->header, val);
}
- sapi_free_header(sapi_header);
-
- return 0;
+ return SAPI_HEADER_ADD;
}
static int
@@ -264,22 +262,17 @@ static void php_apache_sapi_log_message(char *msg)
ctx = SG(server_context);
- /* We use APLOG_STARTUP because it keeps us from printing the
- * data and time information at the beginning of the error log
- * line. Not sure if this is correct, but it mirrors what happens
- * with Apache 1.3 -- rbb
- */
if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, NULL, "%s", msg);
} else {
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, ctx->r, "%s", msg);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, ctx->r, "%s", msg);
}
}
static void php_apache_sapi_log_message_ex(char *msg, request_rec *r)
{
if (r) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_STARTUP, 0, r, msg, r->filename);
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, msg, r->filename);
} else {
php_apache_sapi_log_message(msg);
}
@@ -513,6 +506,7 @@ zend_first_try {
ctx = SG(server_context);
if (ctx == NULL) {
+normal:
ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx));
/* register a cleanup so we clear out the SG(server_context)
* after each request. Note: We pass in the pointer to the
@@ -529,6 +523,11 @@ zend_first_try {
}
} else {
parent_req = ctx->r;
+ /* check if comming due to ErrorDocument */
+ if (parent_req && parent_req->status != HTTP_OK) {
+ parent_req = NULL;
+ goto normal;
+ }
ctx->r = r;
brigade = ctx->brigade;
}
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index d27b51b03..0635e1c05 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.4 2004/07/14 09:55:24 sesser Exp $ */
+/* $Id: mod_php5.c,v 1.4.2.2 2005/06/20 12:46:52 tony2001 Exp $ */
#include "php_apache_http.h"
@@ -95,7 +95,7 @@ static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_
module MODULE_VAR_EXPORT php5_module;
int saved_umask;
-//static int setup_env = 0;
+/* static int setup_env = 0; */
static unsigned char apache_php_initialized;
typedef struct _php_per_dir_entry {
@@ -340,9 +340,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
*p = ':'; /* a well behaved header handler shouldn't change its original arguments */
- efree(sapi_header->header);
-
- return 0; /* don't use the default SAPI mechanism, Apache duplicates this functionality */
+ return SAPI_HEADER_ADD;
}
/* }}} */
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index 538c7dc00..f70e5f837 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: caudium.c,v 1.33 2004/01/17 13:00:10 sniper Exp $ */
+/* $Id: caudium.c,v 1.33.2.1 2005/04/22 09:14:34 tony2001 Exp $ */
#include "php.h"
#ifdef HAVE_CAUDIUM
@@ -287,7 +287,7 @@ php_caudium_set_header(char *header_name, char *value, char *p)
struct svalue *s_headermap, *soldval;
int vallen;
GET_THIS();
- // hval = make_shared_string(value);
+ /* hval = make_shared_string(value); */
ind = make_shared_string(" _headers");
hind = make_shared_binary_string(header_name,
(int)(p - header_name));
@@ -444,7 +444,7 @@ static void php_info_caudium(ZEND_MODULE_INFO_FUNC_ARGS)
{
/* char buf[512]; */
php_info_print_table_start();
- php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.33 2004/01/17 13:00:10 sniper Exp $");
+ php_info_print_table_row(2, "SAPI module version", "$Id: caudium.c,v 1.33.2.1 2005/04/22 09:14:34 tony2001 Exp $");
/* php_info_print_table_row(2, "Build date", Ns_InfoBuildDate());
php_info_print_table_row(2, "Config file path", Ns_InfoConfigFile());
php_info_print_table_row(2, "Error Log path", Ns_InfoErrorLog());
@@ -596,7 +596,7 @@ static void php_caudium_module_main(php_caudium_request *ureq)
Pike_interpreter.recoveries = NULL;
call_c_initializers(Pike_interpreter.thread_id);
state->id=th_self();
- // SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id));
+ /* SWAP_OUT_THREAD(OBJ2THREAD(Pike_interpreter.thread_id)); */
num_threads++;
thread_table_insert(Pike_interpreter.thread_id);
state->status=THREAD_RUNNING;
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 538377328..459ceb985 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: cgi_main.c,v 1.256.2.4 2005/02/11 02:06:48 sniper Exp $ */
+/* $Id: cgi_main.c,v 1.256.2.6 2005/04/28 14:24:21 sniper Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -482,9 +482,14 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
static void sapi_cgi_log_message(char *message)
{
#if PHP_FASTCGI
+ long logging = 1;
TSRMLS_FETCH();
- if (!FCGX_IsCGI()) {
+ if (cfg_get_long("fastcgi.logging", &logging) == FAILURE) {
+ logging = 1;
+ }
+
+ if (!FCGX_IsCGI() && logging) {
FCGX_Request *request = (FCGX_Request *)SG(server_context);
FCGX_FPrintF( request->err, "%s\n", message );
/* ignore return code */
@@ -971,7 +976,7 @@ int main(int argc, char *argv[])
int fcgi_fd = 0;
FCGX_Request request;
#ifdef PHP_WIN32
- int impersonate = 0;
+ long impersonate = 0;
#else
int status = 0;
#endif
diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4
index c4d27771f..6c969c7b2 100644
--- a/sapi/cgi/config9.m4
+++ b/sapi/cgi/config9.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config9.m4,v 1.12.2.2 2005/03/06 23:16:53 sniper Exp $
+dnl $Id: config9.m4,v 1.12.2.3 2005/04/21 15:13:16 sniper Exp $
dnl
AC_ARG_ENABLE(cgi,
@@ -149,7 +149,7 @@ if test "$PHP_SAPI" = "default"; then
AC_DEFINE_UNQUOTED(PHP_FCGI_STATIC, $PHP_FCGI_STATIC, [ ])
AC_MSG_RESULT($PHP_ENABLE_FASTCGI)
- INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)"
+ INSTALL_IT="@echo \"Installing PHP CGI into: \$(INSTALL_ROOT)\$(bindir)/\"; \$(INSTALL) -m 0755 \$(SAPI_CGI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)"
PHP_SELECT_SAPI(cgi, program, $PHP_FCGI_FILES cgi_main.c getopt.c, $PHP_FCGI_INCLUDE, '$(SAPI_CGI_PATH)')
case $host_alias in
diff --git a/sapi/cli/config.m4 b/sapi/cli/config.m4
index aa2c8321d..123df11d7 100644
--- a/sapi/cli/config.m4
+++ b/sapi/cli/config.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config.m4,v 1.18 2003/12/01 15:17:10 sniper Exp $
+dnl $Id: config.m4,v 1.18.2.2 2005/06/20 11:48:25 sniper Exp $
dnl
AC_MSG_CHECKING(for CLI build)
@@ -22,15 +22,14 @@ if test "$PHP_SAPI_CLI" != "no"; then
*darwin*)
BUILD_CLI="\$(CC) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(NATIVE_RPATHS) \$(PHP_GLOBAL_OBJS:.lo=.o) \$(PHP_CLI_OBJS:.lo=.o) \$(PHP_FRAMEWORKS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
- *cygwin*)
- SAPI_CLI_PATH=sapi/cli/php.exe
- BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
+ *netware*)
+ BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -Lnetware -lphp5lib -o \$(SAPI_CLI_PATH)"
;;
*)
BUILD_CLI="\$(LIBTOOL) --mode=link \$(CC) -export-dynamic \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(EXTRA_LDFLAGS_PROGRAM) \$(LDFLAGS) \$(PHP_RPATHS) \$(PHP_GLOBAL_OBJS) \$(PHP_CLI_OBJS) \$(EXTRA_LIBS) \$(ZEND_EXTRA_LIBS) -o \$(SAPI_CLI_PATH)"
;;
esac
- INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)"
+ INSTALL_CLI="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(bindir); \$(INSTALL) -m 0755 \$(SAPI_CLI_PATH) \$(INSTALL_ROOT)\$(bindir)/\$(program_prefix)php\$(program_suffix)\$(EXEEXT)"
PHP_SUBST(BUILD_CLI)
PHP_SUBST(INSTALL_CLI)
diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in
index 0171af057..c6380e296 100644
--- a/sapi/cli/php.1.in
+++ b/sapi/cli/php.1.in
@@ -14,7 +14,7 @@
./" | Author: Marcus Boerger <helly@php.net> |
./" +----------------------------------------------------------------------+
./"
-./" $Id: php.1.in,v 1.7 2004/05/02 09:14:02 helly Exp $
+./" $Id: php.1.in,v 1.7.2.1 2005/04/30 04:12:43 sniper Exp $
./"
.TH PHP 1 "Feb 2003" "The PHP Group" "Scripting Language"
.SH NAME
@@ -348,7 +348,7 @@ For a more or less complete description of PHP look here:
.B http://www.php.net/manual/
.PD 1
.P
-A nice introduction to PHP by Stig Sæther Bakken can be found here:
+A nice introduction to PHP by Stig Bakken can be found here:
.PD 0
.P
.B http://www.zend.com/zend/art/intro.php
diff --git a/sapi/isapi/php5isapi.c b/sapi/isapi/php5isapi.c
index e42e0b814..840450a40 100644
--- a/sapi/isapi/php5isapi.c
+++ b/sapi/isapi/php5isapi.c
@@ -16,7 +16,7 @@
| Ben Mansell <ben@zeus.com> (Zeus Support) |
+----------------------------------------------------------------------+
*/
-/* $Id: php5isapi.c,v 1.3.2.2 2004/12/18 03:14:52 sniper Exp $ */
+/* $Id: php5isapi.c,v 1.3.2.3 2005/04/17 03:39:14 sniper Exp $ */
#include "php.h"
#include <httpext.h>
@@ -57,7 +57,7 @@ exception trapping when running under a debugger
#endif
*/
-#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION")
+#define MAX_STATUS_LENGTH sizeof("xxxx LONGEST POSSIBLE STATUS DESCRIPTION")
#define ISAPI_SERVER_VAR_BUF_SIZE 1024
#define ISAPI_POST_DATA_BUF 1024
@@ -245,8 +245,8 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
char *combined_headers, *combined_headers_ptr;
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
HSE_SEND_HEADER_EX_INFO header_info;
- char status_buf[MAX_STATUS_LENGTH];
sapi_header_struct default_content_type;
+ char *status_buf = NULL;
/* Obtain headers length */
if (SG(sapi_headers).send_default_content_type) {
@@ -277,10 +277,21 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
case 401:
header_info.pszStatus = "401 Authorization Required";
break;
- default:
- snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SG(sapi_headers).http_response_code);
+ default: {
+ const char *sline = SG(sapi_headers).http_status_line;
+
+ status_buf = emalloc(MAX_STATUS_LENGTH + 1);
+
+ /* httpd requires that r->status_line is set to the first digit of
+ * the status-code: */
+ if (sline && strlen(sline) > 12 && strncmp(sline, "HTTP/1.", 7) == 0 && sline[8] == ' ') {
+ status_buf = estrndup(sline + 9, MAX_STATUS_LENGTH);
+ } else {
+ snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SG(sapi_headers).http_response_code);
+ }
header_info.pszStatus = status_buf;
break;
+ }
}
header_info.cchStatus = strlen(header_info.pszStatus);
header_info.pszHeader = combined_headers;
@@ -291,6 +302,9 @@ static int sapi_isapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL);
efree(combined_headers);
+ if (status_buf) {
+ efree(status_buf);
+ }
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
@@ -306,7 +320,6 @@ static int php_isapi_startup(sapi_module_struct *sapi_module)
}
-
static int sapi_isapi_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
LPEXTENSION_CONTROL_BLOCK lpECB = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 5b449b265..86f545bba 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: nsapi.c,v 1.63.2.2 2004/09/20 13:29:44 thetaphi Exp $ */
+/* $Id: nsapi.c,v 1.63.2.3 2005/07/04 12:47:26 dmitry Exp $ */
/*
* PHP includes
@@ -310,7 +310,7 @@ PHP_MSHUTDOWN_FUNCTION(nsapi)
PHP_MINFO_FUNCTION(nsapi)
{
php_info_print_table_start();
- php_info_print_table_row(2, "NSAPI Module Revision", "$Revision: 1.63.2.2 $");
+ php_info_print_table_row(2, "NSAPI Module Revision", "$Revision: 1.63.2.3 $");
php_info_print_table_row(2, "Server Software", system_version());
php_info_print_table_row(2, "Sub-requests with nsapi_virtual()",
(nsapi_servact_service)?((zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0))?"not supported with zlib.output_compression":"enabled"):"not supported on this platform" );
@@ -768,7 +768,7 @@ static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC)
/* change the ini entry */
if (zend_alter_ini_entry(entry->param->name, strlen(entry->param->name)+1,
entry->param->value, strlen(entry->param->value),
- PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME)==FAILURE) {
+ PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE)==FAILURE) {
log_error(LOG_WARN, pblock_findval("fn", NSG(pb)), NSG(sn), NSG(rq), "Cannot change php.ini key \"%s\" to \"%s\"", entry->param->name, entry->param->value);
}
}
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index feeb85af8..6e931d9c8 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pi3web_sapi.c,v 1.57.2.1 2004/12/05 10:32:30 holger Exp $ */
+/* $Id: pi3web_sapi.c,v 1.57.2.2 2005/06/26 16:36:59 holger Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -57,7 +57,7 @@ static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS)
PUTS("<table border=0 cellpadding=3 cellspacing=1 width=600 align=center>\n");
PUTS("<tr><th colspan=2 bgcolor=\"" PHP_HEADER_COLOR "\">Pi3Web Server Information</th></tr>\n");
php_info_print_table_header(2, "Information Field", "Value");
- php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.57.2.1 2004/12/05 10:32:30 holger Exp $");
+ php_info_print_table_row(2, "Pi3Web SAPI module version", "$Id: pi3web_sapi.c,v 1.57.2.2 2005/06/26 16:36:59 holger Exp $");
php_info_print_table_row(2, "Server Name Stamp", HTTPCore_getServerStamp());
snprintf(variable_buf, 511, "%d", HTTPCore_debugEnabled());
php_info_print_table_row(2, "Debug Enabled", variable_buf);
@@ -82,7 +82,7 @@ static void php_info_pi3web(ZEND_MODULE_INFO_FUNC_ARGS)
/* --- loop over all registered server variables --- */
for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) )
{
- PCHAR pKey;
+ CHAR *pKey;
PIDBIterator_current( pIter, &pKey );
if ( !pKey ) { /* sanity */ continue; };
@@ -289,7 +289,7 @@ static void sapi_pi3web_register_variables(zval *track_vars_array TSRMLS_DC)
/* --- loop over all registered server variables --- */
for(; pIter && PIDBIterator_atValidElement( pIter ); PIDBIterator_next( pIter ) )
{
- PCHAR pKey;
+ CHAR *pKey;
PIDBIterator_current( pIter, &pKey );
if ( !pKey ) { /* sanity */ continue; };