cvs: php-src(PHP_5_3) /sapi/apache php_apache.c

From: Date: Tue, 01 Jul 2008 07:58:42 +0000
Subject: cvs: php-src(PHP_5_3) /sapi/apache php_apache.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-50715@lists.php.net to get a copy of this message
tony2001 Tue Jul 1 07:58:42 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/sapi/apache php_apache.c Log: long -> int + minor sources reorganization http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/php_apache.c?r1=1.89.2.4.2.6.2.3&r2=1.89.2.4.2.6.2.4&diff_format=u Index: php-src/sapi/apache/php_apache.c diff -u php-src/sapi/apache/php_apache.c:1.89.2.4.2.6.2.3 php-src/sapi/apache/php_apache.c:1.89.2.4.2.6.2.4 --- php-src/sapi/apache/php_apache.c:1.89.2.4.2.6.2.3 Sat Jun 28 09:52:03 2008 +++ php-src/sapi/apache/php_apache.c Tue Jul 1 07:58:42 2008 @@ -17,7 +17,7 @@ | David Sklar <sklar@student.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_apache.c,v 1.89.2.4.2.6.2.3 2008/06/28 09:52:03 indeyets Exp $ */ +/* $Id: php_apache.c,v 1.89.2.4.2.6.2.4 2008/07/01 07:58:42 tony2001 Exp $ */ #include "php_apache_http.h" @@ -118,52 +118,6 @@ 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) -{ - char *note_name, *note_val; - long note_name_len, note_val_len; - char *old_val; - int arg_count = ZEND_NUM_ARGS(); - - if (zend_parse_parameters(arg_count 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 (arg_count == 2) { - table_set(((request_rec *)SG(server_context))->notes, note_name, note_val); - } - - if (old_val) { - RETURN_STRING(old_val, 1); - } - - RETURN_FALSE; -} -/* }}} */ - /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(apache) @@ -296,6 +250,52 @@ } /* }}} */ +/* {{{ 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; + int note_name_len, note_val_len; + char *old_val; + int arg_count = ZEND_NUM_ARGS(); + + if (zend_parse_parameters(arg_count 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 (arg_count == 2) { + 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...--> @@ -309,7 +309,7 @@ PHP_FUNCTION(virtual) { char *filename; - long filename_len; + int filename_len; request_rec *rr = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { @@ -350,6 +350,7 @@ /* {{{ 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) @@ -398,7 +399,7 @@ Set an Apache subprocess_env variable */ PHP_FUNCTION(apache_setenv) { - long var_len, val_len; + int var_len, val_len; zend_bool top=0; char *var = NULL, *val = NULL; request_rec *r = (request_rec *) SG(server_context); @@ -422,7 +423,7 @@ PHP_FUNCTION(apache_lookup_uri) { char *filename; - long filename_len; + int filename_len; request_rec *rr=NULL; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { @@ -499,7 +500,7 @@ PHP_FUNCTION(apache_exec_uri) { char *filename; - long filename_len; + int filename_len; request_rec *rr=NULL; TSRMLS_FETCH();

« previous php.cvs (#50715) next »