summaryrefslogtreecommitdiff
path: root/sapi/apache
diff options
context:
space:
mode:
authorSean Finney <seanius@debian.org>2010-02-07 22:19:53 +0100
committerSean Finney <seanius@debian.org>2010-02-07 22:27:07 +0100
commitc852c28a88fccf6e34a2cb091fdfa72bce2b59c7 (patch)
tree91f01b0d06916c78262404096bfd466b8e95e5b5 /sapi/apache
parent176cbd0bc99e20bb21f92f0b72df728eafc1e2ce (diff)
parent0fab6db7cac8d2be99579dd049f812a8ff98e74f (diff)
downloadphp-c852c28a88fccf6e34a2cb091fdfa72bce2b59c7.tar.gz
Merge branch 'upstream-experimental' into upstream-sid
Diffstat (limited to 'sapi/apache')
-rw-r--r--sapi/apache/config.w326
-rw-r--r--sapi/apache/libpre.c2
-rw-r--r--sapi/apache/mod_php5.c88
-rw-r--r--sapi/apache/mod_php5.h8
-rw-r--r--sapi/apache/php_apache.c260
-rw-r--r--sapi/apache/php_apache_http.h4
-rw-r--r--sapi/apache/sapi_apache.c2
7 files changed, 219 insertions, 151 deletions
diff --git a/sapi/apache/config.w32 b/sapi/apache/config.w32
index e3bc80ace..79e246655 100644
--- a/sapi/apache/config.w32
+++ b/sapi/apache/config.w32
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32 149024 2004-01-17 13:00:38Z sniper $
+// $Id: config.w32 257603 2008-04-15 16:55:53Z auroraeosrose $
ARG_ENABLE('apache', 'Build Apache 1.3.x version of PHP', 'no');
@@ -9,10 +9,10 @@ ARG_WITH('apache-libs', 'Where to find Apache 1.3 libraries', null);
if (PHP_APACHE != "no") {
if (CHECK_HEADER_ADD_INCLUDE("httpd.h", "CFLAGS_APACHE", php_usual_include_suspects +
";" + PROGRAM_FILES + "\\Apache Group\\Apache\\include" +
- ";..\\php_build\\apache\\src\\include") &&
+ ";" + PHP_PHP_BUILD + "\\apache\\src\\include") &&
CHECK_LIB("ApacheCore.lib", "apache", php_usual_lib_suspects +
';' + PROGRAM_FILES + '\\Apache Group\\Apache\\libexec' +
- ';..\\php_build\\apache\\src\\corer')) {
+ ";" + PHP_PHP_BUILD + "\\apache\\src\\corer")) {
// We need to play tricks to get our readdir.h used by apache
// headers
SAPI('apache', 'mod_php5.c sapi_apache.c php_apache.c',
diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c
index 5a015df54..2fc8c2ac4 100644
--- a/sapi/apache/libpre.c
+++ b/sapi/apache/libpre.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: libpre.c 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: libpre.c 272370 2008-12-31 11:15:49Z sebastian $ */
#ifdef NETWARE
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 9ae3541df..ce0f81967 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 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: mod_php5.c 272370 2008-12-31 11:15:49Z sebastian $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -26,10 +26,6 @@
#define SIGPIPE SIGINT
#endif
-#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
-#include "ext/mbstring/mbstring.h"
-#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */
-
#undef shutdown
/* {{{ Prototypes
@@ -39,7 +35,7 @@ static void php_save_umask(void);
static void php_restore_umask(void);
static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC);
static char *sapi_apache_read_cookies(TSRMLS_D);
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC);
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC);
static int send_php(request_rec *r, int display_source_mode, char *filename);
static int send_parsed_php(request_rec * r);
@@ -167,41 +163,54 @@ static char *sapi_apache_read_cookies(TSRMLS_D)
/* {{{ sapi_apache_header_handler
*/
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
if(!r) {
- efree(sapi_header->header);
return 0;
}
- header_name = sapi_header->header;
+ switch(op) {
+ case SAPI_HEADER_DELETE_ALL:
+ clear_table(r->headers_out);
+ return 0;
- header_content = p = strchr(header_name, ':');
- if (!p) {
- efree(sapi_header->header);
- return 0;
- }
+ case SAPI_HEADER_DELETE:
+ table_unset(r->headers_out, sapi_header->header);
+ return 0;
- *p = 0;
- do {
- header_content++;
- } while (*header_content==' ');
-
- if (!strcasecmp(header_name, "Content-Type")) {
- r->content_type = pstrdup(r->pool, header_content);
- } else if (!strcasecmp(header_name, "Set-Cookie")) {
- table_add(r->headers_out, header_name, header_content);
- } else if (sapi_header->replace) {
- table_set(r->headers_out, header_name, header_content);
- } else {
- table_add(r->headers_out, header_name, header_content);
- }
+ case SAPI_HEADER_ADD:
+ case SAPI_HEADER_REPLACE:
+ header_name = sapi_header->header;
+
+ header_content = p = strchr(header_name, ':');
+ if (!p) {
+ return 0;
+ }
+
+ *p = 0;
+ do {
+ header_content++;
+ } while (*header_content==' ');
+
+ if (!strcasecmp(header_name, "Content-Type")) {
+ r->content_type = pstrdup(r->pool, header_content);
+ } else if (!strcasecmp(header_name, "Set-Cookie")) {
+ table_add(r->headers_out, header_name, header_content);
+ } else if (op == SAPI_HEADER_REPLACE) {
+ table_set(r->headers_out, header_name, header_content);
+ } else {
+ table_add(r->headers_out, header_name, header_content);
+ }
- *p = ':'; /* a well behaved header handler shouldn't change its original arguments */
+ *p = ':'; /* a well behaved header handler shouldn't change its original arguments */
- return SAPI_HEADER_ADD;
+ return SAPI_HEADER_ADD;
+
+ default:
+ return 0;
+ }
}
/* }}} */
@@ -247,7 +256,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
table_entry *elts = (table_entry *) arr->elts;
zval **path_translated;
HashTable *symbol_table;
- int new_val_len;
+ unsigned int new_val_len;
for (i = 0; i < arr->nelts; i++) {
char *val;
@@ -438,6 +447,16 @@ static time_t php_apache_get_request_time(TSRMLS_D)
}
/* }}} */
+/* {{{ sapi_apache_child_terminate
+ */
+static void sapi_apache_child_terminate(TSRMLS_D)
+{
+#ifndef MULTITHREAD
+ ap_child_terminate((request_rec *)SG(server_context));
+#endif
+}
+/* }}} */
+
/* {{{ sapi_module_struct apache_sapi_module
*/
static sapi_module_struct apache_sapi_module = {
@@ -467,6 +486,7 @@ static sapi_module_struct apache_sapi_module = {
sapi_apache_register_server_variables, /* register server variables */
php_apache_log_message, /* Log message */
php_apache_get_request_time, /* Get request time */
+ sapi_apache_child_terminate,
NULL, /* php.ini path override */
@@ -589,10 +609,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
-#if defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING)
- php_mb_set_zend_encoding(TSRMLS_C);
-#endif /* defined(ZEND_MULTIBYTE) && defined(HAVE_MBSTRING) */
-
zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
return OK;
}
@@ -680,7 +696,7 @@ static int send_parsed_php(request_rec * r)
TSRMLS_FETCH();
ap_table_setn(r->notes, "mod_php_memory_usage",
- ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC)));
+ ap_psprintf(r->pool, "%lu", zend_memory_peak_usage(1 TSRMLS_CC)));
return result;
}
diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php5.h
index a389b88c9..7f7c159e1 100644
--- a/sapi/apache/mod_php5.h
+++ b/sapi/apache/mod_php5.h
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf <rasmus@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.h 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: mod_php5.h 272370 2008-12-31 11:15:49Z sebastian $ */
#ifndef MOD_PHP5_H
#define MOD_PHP5_H
@@ -44,6 +44,12 @@ extern php_apache_info_struct php_apache_info;
#define AP(v) (php_apache_info.v)
#endif
+/* fix for gcc4 visibility patch */
+#ifndef PHP_WIN32
+# undef MODULE_VAR_EXPORT
+# define MODULE_VAR_EXPORT PHPAPI
+#endif
+
#endif /* MOD_PHP5_H */
/*
diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c
index 5caf3be49..09e8a6519 100644
--- a/sapi/apache/php_apache.c
+++ b/sapi/apache/php_apache.c
@@ -17,7 +17,7 @@
| David Sklar <sklar@student.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache.c 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: php_apache.c 272840 2009-01-05 16:24:26Z iliaa $ */
#include "php_apache_http.h"
@@ -56,18 +56,57 @@ PHP_FUNCTION(apache_reset_timeout);
PHP_MINFO_FUNCTION(apache);
-zend_function_entry apache_functions[] = {
- PHP_FE(virtual, NULL)
- PHP_FE(apache_request_headers, NULL)
- PHP_FE(apache_note, NULL)
- PHP_FE(apache_lookup_uri, NULL)
- PHP_FE(apache_child_terminate, NULL)
- PHP_FE(apache_setenv, NULL)
- PHP_FE(apache_response_headers, NULL)
- PHP_FE(apache_get_version, NULL)
- PHP_FE(apache_get_modules, NULL)
- PHP_FE(apache_reset_timeout, NULL)
- PHP_FALIAS(getallheaders, apache_request_headers, NULL)
+ZEND_BEGIN_ARG_INFO(arginfo_apache_child_terminate, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_note, 0, 0, 1)
+ ZEND_ARG_INFO(0, note_name)
+ ZEND_ARG_INFO(0, note_value)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_virtual, 0, 0, 1)
+ ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_apache_request_headers, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_apache_response_headers, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_setenv, 0, 0, 2)
+ ZEND_ARG_INFO(0, variable)
+ ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, walk_to_top)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_lookup_uri, 0, 0, 1)
+ ZEND_ARG_INFO(0, uri)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_apache_get_version, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_apache_get_modules, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_apache_reset_timeout, 0)
+ZEND_END_ARG_INFO()
+
+
+
+const zend_function_entry apache_functions[] = {
+ PHP_FE(virtual, arginfo_apache_virtual)
+ PHP_FE(apache_request_headers, arginfo_apache_request_headers)
+ PHP_FE(apache_note, arginfo_apache_note)
+ PHP_FE(apache_lookup_uri, arginfo_apache_lookup_uri)
+ PHP_FE(apache_child_terminate, arginfo_apache_child_terminate)
+ PHP_FE(apache_setenv, arginfo_apache_setenv)
+ PHP_FE(apache_response_headers, arginfo_apache_response_headers)
+ PHP_FE(apache_get_version, arginfo_apache_get_version)
+ PHP_FE(apache_get_modules, arginfo_apache_get_modules)
+ PHP_FE(apache_reset_timeout, arginfo_apache_reset_timeout)
+ PHP_FALIAS(getallheaders, apache_request_headers, arginfo_apache_request_headers)
{NULL, NULL, NULL}
};
@@ -118,54 +157,6 @@ zend_module_entry apache_module_entry = {
STANDARD_MODULE_PROPERTIES
};
-/* {{{ proto bool apache_child_terminate(void)
- Terminate apache process after this request */
-PHP_FUNCTION(apache_child_terminate)
-{
-#ifndef MULTITHREAD
- if (AP(terminate_child)) {
- ap_child_terminate( ((request_rec *)SG(server_context)) );
- RETURN_TRUE;
- } else { /* tell them to get lost! */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled");
- RETURN_FALSE;
- }
-#else
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build");
- RETURN_FALSE;
-#endif
-}
-/* }}} */
-
-/* {{{ proto string apache_note(string note_name [, string note_value])
- Get and set Apache request notes */
-PHP_FUNCTION(apache_note)
-{
- zval **arg_name, **arg_val;
- char *note_val;
- int arg_count = ZEND_NUM_ARGS();
-
- if (arg_count<1 || arg_count>2 ||
- zend_get_parameters_ex(arg_count, &arg_name, &arg_val) ==FAILURE ) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(arg_name);
- note_val = (char *) table_get(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val);
-
- if (arg_count == 2) {
- convert_to_string_ex(arg_val);
- table_set(((request_rec *)SG(server_context))->notes, (*arg_name)->value.str.val, (*arg_val)->value.str.val);
- }
-
- if (note_val) {
- RETURN_STRING(note_val, 1);
- } else {
- RETURN_FALSE;
- }
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(apache)
@@ -298,6 +289,51 @@ PHP_MINFO_FUNCTION(apache)
}
/* }}} */
+/* {{{ proto bool apache_child_terminate(void)
+ Terminate apache process after this request */
+PHP_FUNCTION(apache_child_terminate)
+{
+#ifndef MULTITHREAD
+ if (AP(terminate_child)) {
+ ap_child_terminate( ((request_rec *)SG(server_context)) );
+ RETURN_TRUE;
+ } else { /* tell them to get lost! */
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled");
+ RETURN_FALSE;
+ }
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build");
+ RETURN_FALSE;
+#endif
+}
+/* }}} */
+
+/* {{{ proto string apache_note(string note_name [, string note_value])
+ Get and set Apache request notes */
+PHP_FUNCTION(apache_note)
+{
+ char *note_name, *note_val = NULL;
+ int note_name_len, note_val_len;
+ char *old_val;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
+ return;
+ }
+
+ old_val = (char *) table_get(((request_rec *)SG(server_context))->notes, note_name);
+
+ if (note_val) {
+ table_set(((request_rec *)SG(server_context))->notes, note_name, note_val);
+ }
+
+ if (old_val) {
+ RETURN_STRING(old_val, 1);
+ }
+
+ RETURN_FALSE;
+}
+/* }}} */
+
/* {{{ proto bool virtual(string filename)
Perform an Apache sub-request */
/* This function is equivalent to <!--#include virtual...-->
@@ -310,23 +346,25 @@ PHP_MINFO_FUNCTION(apache)
*/
PHP_FUNCTION(virtual)
{
- zval **filename;
+ char *filename;
+ int filename_len;
request_rec *rr = NULL;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ return;
}
- convert_to_string_ex(filename);
- if (!(rr = sub_req_lookup_uri ((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", (*filename)->value.str.val);
- if (rr) destroy_sub_req (rr);
+ if (!(rr = sub_req_lookup_uri (filename, ((request_rec *) SG(server_context))))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
+ if (rr)
+ destroy_sub_req (rr);
RETURN_FALSE;
}
if (rr->status != 200) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", (*filename)->value.str.val);
- if (rr) destroy_sub_req (rr);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
+ if (rr)
+ destroy_sub_req (rr);
RETURN_FALSE;
}
@@ -334,31 +372,35 @@ PHP_FUNCTION(virtual)
php_header(TSRMLS_C);
if (run_sub_req(rr)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", (*filename)->value.str.val);
- if (rr) destroy_sub_req (rr);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename);
+ if (rr)
+ destroy_sub_req (rr);
RETURN_FALSE;
- } else {
- if (rr) destroy_sub_req (rr);
- RETURN_TRUE;
}
+
+ if (rr)
+ destroy_sub_req (rr);
+
+ RETURN_TRUE;
}
/* }}} */
/* {{{ proto array getallheaders(void)
Alias for apache_request_headers() */
/* }}} */
+
/* {{{ proto array apache_request_headers(void)
Fetch all HTTP request headers */
PHP_FUNCTION(apache_request_headers)
{
- array_header *env_arr;
- table_entry *tenv;
- int i;
-
- array_init(return_value);
- env_arr = table_elts(((request_rec *) SG(server_context))->headers_in);
- tenv = (table_entry *)env_arr->elts;
- for (i = 0; i < env_arr->nelts; ++i) {
+ array_header *env_arr;
+ table_entry *tenv;
+ int i;
+
+ array_init(return_value);
+ env_arr = table_elts(((request_rec *) SG(server_context))->headers_in);
+ tenv = (table_entry *)env_arr->elts;
+ for (i = 0; i < env_arr->nelts; ++i) {
if (!tenv[i].key ||
(PG(safe_mode) &&
!strncasecmp(tenv[i].key, "authorization", 13))) {
@@ -375,14 +417,14 @@ PHP_FUNCTION(apache_request_headers)
Fetch all HTTP response headers */
PHP_FUNCTION(apache_response_headers)
{
- array_header *env_arr;
- table_entry *tenv;
- int i;
-
- array_init(return_value);
- env_arr = table_elts(((request_rec *) SG(server_context))->headers_out);
- tenv = (table_entry *)env_arr->elts;
- for (i = 0; i < env_arr->nelts; ++i) {
+ array_header *env_arr;
+ table_entry *tenv;
+ int i;
+
+ array_init(return_value);
+ env_arr = table_elts(((request_rec *) SG(server_context))->headers_out);
+ tenv = (table_entry *)env_arr->elts;
+ for (i = 0; i < env_arr->nelts; ++i) {
if (!tenv[i].key) continue;
if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
RETURN_FALSE;
@@ -400,8 +442,8 @@ PHP_FUNCTION(apache_setenv)
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
- RETURN_FALSE;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
+ return;
}
while(top) {
@@ -418,20 +460,22 @@ PHP_FUNCTION(apache_setenv)
Perform a partial request of the given URI to obtain information about it */
PHP_FUNCTION(apache_lookup_uri)
{
- zval **filename;
+ char *filename;
+ int filename_len;
request_rec *rr=NULL;
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ return;
}
- convert_to_string_ex(filename);
- if(!(rr = sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", (*filename)->value.str.val);
+ if (!(rr = sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", filename);
RETURN_FALSE;
}
+
object_init(return_value);
add_property_long(return_value,"status", rr->status);
+
if (rr->the_request) {
add_property_string(return_value,"the_request", rr->the_request, 1);
}
@@ -462,6 +506,7 @@ PHP_FUNCTION(apache_lookup_uri)
if (rr->boundary) {
add_property_string(return_value,"boundary", rr->boundary, 1);
}
+
add_property_long(return_value,"no_cache", rr->no_cache);
add_property_long(return_value,"no_local_copy", rr->no_local_copy);
add_property_long(return_value,"allowed", rr->allowed);
@@ -492,19 +537,20 @@ This function is most likely a bad idea. Just playing with it for now.
PHP_FUNCTION(apache_exec_uri)
{
- zval **filename;
+ char *filename;
+ int filename_len;
request_rec *rr=NULL;
TSRMLS_FETCH();
- if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &filename) == FAILURE) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ return;
}
- convert_to_string_ex(filename);
- if(!(rr = ap_sub_req_lookup_uri((*filename)->value.str.val, ((request_rec *) SG(server_context))))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", (*filename)->value.str.val);
+ if(!(rr = ap_sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", filename);
RETURN_FALSE;
}
+
RETVAL_LONG(ap_run_sub_req(rr));
ap_destroy_sub_req(rr);
}
@@ -518,9 +564,9 @@ PHP_FUNCTION(apache_get_version)
if (apv && *apv) {
RETURN_STRING(apv, 1);
- } else {
- RETURN_FALSE;
}
+
+ RETURN_FALSE;
}
/* }}} */
diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h
index 0020a1f5a..936484a15 100644
--- a/sapi/apache/php_apache_http.h
+++ b/sapi/apache/php_apache_http.h
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_apache_http.h 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: php_apache_http.h 272370 2008-12-31 11:15:49Z sebastian $ */
#define NO_REGEX_EXTRA_H
@@ -31,7 +31,7 @@
#endif
#include "zend.h"
-#include "php_regex.h"
+#include "ext/ereg/php_regex.h"
#include "php_compat.h"
#ifdef HAVE_OPENSSL_EXT
diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c
index 632cd965b..dce6e5bcc 100644
--- a/sapi/apache/sapi_apache.c
+++ b/sapi/apache/sapi_apache.c
@@ -19,7 +19,7 @@
| Stig Bakken <ssb@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache.c 272374 2008-12-31 11:17:49Z sebastian $ */
+/* $Id: sapi_apache.c 272370 2008-12-31 11:15:49Z sebastian $ */
#include "php_apache_http.h"