Back to index

php5  5.3.10
php_apache.c
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
00016    |          Stig Sæther Bakken <ssb@php.net>                            |
00017    |          David Sklar <sklar@student.net>                             |
00018    +----------------------------------------------------------------------+
00019  */
00020 /* $Id: php_apache.c 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #include "php_apache_http.h"
00023 
00024 #if defined(PHP_WIN32) || defined(NETWARE)
00025 #include "zend.h"
00026 #include "ap_compat.h"
00027 #endif
00028 
00029 #ifdef ZTS
00030 int php_apache_info_id;
00031 #else
00032 php_apache_info_struct php_apache_info;
00033 #endif
00034 
00035 #define SECTION(name)  PUTS("<h2>" name "</h2>\n")
00036 
00037 #ifndef PHP_WIN32
00038 extern module *top_module;
00039 extern module **ap_loaded_modules;
00040 #else
00041 extern  __declspec(dllimport) module *top_module;
00042 extern  __declspec(dllimport) module **ap_loaded_modules;
00043 #endif
00044 
00045 PHP_FUNCTION(virtual);
00046 PHP_FUNCTION(apache_request_headers);
00047 PHP_FUNCTION(apache_response_headers);
00048 PHP_FUNCTION(apachelog);
00049 PHP_FUNCTION(apache_note);
00050 PHP_FUNCTION(apache_lookup_uri);
00051 PHP_FUNCTION(apache_child_terminate);
00052 PHP_FUNCTION(apache_setenv);
00053 PHP_FUNCTION(apache_get_version);
00054 PHP_FUNCTION(apache_get_modules);
00055 PHP_FUNCTION(apache_reset_timeout);
00056 
00057 PHP_MINFO_FUNCTION(apache);
00058 
00059 ZEND_BEGIN_ARG_INFO(arginfo_apache_child_terminate, 0)
00060 ZEND_END_ARG_INFO()
00061 
00062 ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_note, 0, 0, 1)
00063        ZEND_ARG_INFO(0, note_name)
00064        ZEND_ARG_INFO(0, note_value)
00065 ZEND_END_ARG_INFO()
00066 
00067 ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_virtual, 0, 0, 1)
00068        ZEND_ARG_INFO(0, filename)
00069 ZEND_END_ARG_INFO()
00070 
00071 ZEND_BEGIN_ARG_INFO(arginfo_apache_request_headers, 0)
00072 ZEND_END_ARG_INFO()
00073 
00074 ZEND_BEGIN_ARG_INFO(arginfo_apache_response_headers, 0)
00075 ZEND_END_ARG_INFO()
00076 
00077 ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_setenv, 0, 0, 2)
00078        ZEND_ARG_INFO(0, variable)
00079        ZEND_ARG_INFO(0, value)
00080        ZEND_ARG_INFO(0, walk_to_top)
00081 ZEND_END_ARG_INFO()
00082 
00083 ZEND_BEGIN_ARG_INFO_EX(arginfo_apache_lookup_uri, 0, 0, 1)
00084        ZEND_ARG_INFO(0, uri)
00085 ZEND_END_ARG_INFO()
00086 
00087 ZEND_BEGIN_ARG_INFO(arginfo_apache_get_version, 0)
00088 ZEND_END_ARG_INFO()
00089 
00090 ZEND_BEGIN_ARG_INFO(arginfo_apache_get_modules, 0)
00091 ZEND_END_ARG_INFO()
00092 
00093 ZEND_BEGIN_ARG_INFO(arginfo_apache_reset_timeout, 0)
00094 ZEND_END_ARG_INFO()
00095 
00096 
00097 
00098 const zend_function_entry apache_functions[] = {
00099        PHP_FE(virtual,                                                              arginfo_apache_virtual)
00100        PHP_FE(apache_request_headers,                                 arginfo_apache_request_headers)
00101        PHP_FE(apache_note,                                                   arginfo_apache_note)
00102        PHP_FE(apache_lookup_uri,                                      arginfo_apache_lookup_uri)
00103        PHP_FE(apache_child_terminate,                                 arginfo_apache_child_terminate)
00104        PHP_FE(apache_setenv,                                                 arginfo_apache_setenv)
00105        PHP_FE(apache_response_headers,                                arginfo_apache_response_headers)
00106        PHP_FE(apache_get_version,                                     arginfo_apache_get_version)
00107        PHP_FE(apache_get_modules,                                     arginfo_apache_get_modules)
00108        PHP_FE(apache_reset_timeout,                                   arginfo_apache_reset_timeout)
00109        PHP_FALIAS(getallheaders, apache_request_headers, arginfo_apache_request_headers)
00110        {NULL, NULL, NULL}
00111 };
00112 
00113 
00114 PHP_INI_BEGIN()
00115        STD_PHP_INI_ENTRY("xbithack",                    "0",                        PHP_INI_ALL,         OnUpdateLong,        xbithack, php_apache_info_struct, php_apache_info)
00116        STD_PHP_INI_ENTRY("engine",                      "1",                        PHP_INI_ALL,         OnUpdateLong,        engine, php_apache_info_struct, php_apache_info)
00117        STD_PHP_INI_ENTRY("last_modified",        "0",                        PHP_INI_ALL,         OnUpdateLong,        last_modified, php_apache_info_struct, php_apache_info)
00118        STD_PHP_INI_ENTRY("child_terminate",      "0",                        PHP_INI_ALL,         OnUpdateLong,        terminate_child, php_apache_info_struct, php_apache_info)
00119 PHP_INI_END()
00120 
00121 
00122 
00123 static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC)
00124 {
00125        apache_globals->in_request = 0;
00126 }
00127 
00128 
00129 static PHP_MINIT_FUNCTION(apache)
00130 {
00131 #ifdef ZTS
00132        ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
00133 #else
00134        php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
00135 #endif
00136        REGISTER_INI_ENTRIES();
00137        return SUCCESS;
00138 }
00139 
00140 
00141 static PHP_MSHUTDOWN_FUNCTION(apache)
00142 {
00143        UNREGISTER_INI_ENTRIES();
00144        return SUCCESS;
00145 }
00146 
00147 zend_module_entry apache_module_entry = {
00148        STANDARD_MODULE_HEADER,
00149        "apache", 
00150        apache_functions, 
00151        PHP_MINIT(apache), 
00152        PHP_MSHUTDOWN(apache), 
00153        NULL, 
00154        NULL, 
00155        PHP_MINFO(apache), 
00156        NO_VERSION_YET,
00157        STANDARD_MODULE_PROPERTIES
00158 };
00159 
00160 /* {{{ PHP_MINFO_FUNCTION
00161  */
00162 PHP_MINFO_FUNCTION(apache)
00163 {
00164        char *apv = (char *) ap_get_server_version();
00165        module *modp = NULL;
00166        char output_buf[128];
00167 #if !defined(WIN32) && !defined(WINNT)
00168        char name[64];
00169        char modulenames[1024];
00170        char *p;
00171 #endif
00172        server_rec *serv;
00173        extern char server_root[MAX_STRING_LEN];
00174        extern uid_t user_id;
00175        extern char *user_name;
00176        extern gid_t group_id;
00177        extern int max_requests_per_child;
00178 
00179        serv = ((request_rec *) SG(server_context))->server;
00180 
00181 
00182        php_info_print_table_start();
00183 
00184 #ifdef PHP_WIN32
00185        php_info_print_table_row(1, "Apache for Windows 95/NT");
00186        php_info_print_table_end();
00187        php_info_print_table_start();
00188 #elif defined(NETWARE)
00189        php_info_print_table_row(1, "Apache for NetWare");
00190        php_info_print_table_end();
00191        php_info_print_table_start();
00192 #else
00193        php_info_print_table_row(2, "APACHE_INCLUDE", PHP_APACHE_INCLUDE);
00194        php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET);
00195 #endif
00196 
00197        if (apv && *apv) {
00198               php_info_print_table_row(2, "Apache Version", apv);
00199        } 
00200 
00201 #ifdef APACHE_RELEASE
00202        snprintf(output_buf, sizeof(output_buf), "%d", APACHE_RELEASE);
00203        php_info_print_table_row(2, "Apache Release", output_buf);
00204 #endif
00205        snprintf(output_buf, sizeof(output_buf), "%d", MODULE_MAGIC_NUMBER);
00206        php_info_print_table_row(2, "Apache API Version", output_buf);
00207        snprintf(output_buf, sizeof(output_buf), "%s:%u", serv->server_hostname, serv->port);
00208        php_info_print_table_row(2, "Hostname:Port", output_buf);
00209 #if !defined(WIN32) && !defined(WINNT)
00210        snprintf(output_buf, sizeof(output_buf), "%s(%d)/%d", user_name, (int)user_id, (int)group_id);
00211        php_info_print_table_row(2, "User/Group", output_buf);
00212        snprintf(output_buf, sizeof(output_buf), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests_per_child, serv->keep_alive ? "on":"off", serv->keep_alive_max);
00213        php_info_print_table_row(2, "Max Requests", output_buf);
00214 #endif
00215        snprintf(output_buf, sizeof(output_buf), "Connection: %d - Keep-Alive: %d", serv->timeout, serv->keep_alive_timeout);
00216        php_info_print_table_row(2, "Timeouts", output_buf);
00217 #if !defined(WIN32) && !defined(WINNT)
00218 /*
00219        This block seems to be working on NetWare; But it seems to be showing
00220        all modules instead of just the loaded ones
00221 */
00222        php_info_print_table_row(2, "Server Root", server_root);
00223 
00224        strcpy(modulenames, "");
00225        for(modp = top_module; modp; modp = modp->next) {
00226               strlcpy(name, modp->name, sizeof(name));
00227               if ((p = strrchr(name, '.'))) {
00228                      *p='\0'; /* Cut off ugly .c extensions on module names */
00229               }
00230               strlcat(modulenames, name, sizeof(modulenames));
00231               if (modp->next) {
00232                      strlcat(modulenames, ", ", sizeof(modulenames));
00233               }
00234        }
00235        php_info_print_table_row(2, "Loaded Modules", modulenames);
00236 #endif
00237 
00238        php_info_print_table_end();
00239 
00240        DISPLAY_INI_ENTRIES();
00241 
00242        {
00243               register int i;
00244               array_header *arr;
00245               table_entry *elts;
00246               request_rec *r;
00247 
00248               r = ((request_rec *) SG(server_context));
00249               arr = table_elts(r->subprocess_env);
00250               elts = (table_entry *)arr->elts;
00251               
00252               SECTION("Apache Environment");
00253               php_info_print_table_start();      
00254               php_info_print_table_header(2, "Variable", "Value");
00255               for (i=0; i < arr->nelts; i++) {
00256                      php_info_print_table_row(2, elts[i].key, elts[i].val);
00257               }
00258               php_info_print_table_end(); 
00259        }
00260 
00261        {
00262               array_header *env_arr;
00263               table_entry *env;
00264               int i;
00265               request_rec *r;
00266               
00267               r = ((request_rec *) SG(server_context));
00268               SECTION("HTTP Headers Information");
00269               php_info_print_table_start();
00270               php_info_print_table_colspan_header(2, "HTTP Request Headers");
00271               php_info_print_table_row(2, "HTTP Request", r->the_request);
00272               env_arr = table_elts(r->headers_in);
00273               env = (table_entry *)env_arr->elts;
00274               for (i = 0; i < env_arr->nelts; ++i) {
00275                      if (env[i].key && (!PG(safe_mode) || (PG(safe_mode) && strncasecmp(env[i].key, "authorization", 13)))) {
00276                             php_info_print_table_row(2, env[i].key, env[i].val);
00277                      }
00278               }
00279               php_info_print_table_colspan_header(2, "HTTP Response Headers");
00280               env_arr = table_elts(r->headers_out);
00281               env = (table_entry *)env_arr->elts;
00282               for(i = 0; i < env_arr->nelts; ++i) {
00283                      if (env[i].key) {
00284                             php_info_print_table_row(2, env[i].key, env[i].val);
00285                      }
00286               }
00287               php_info_print_table_end();
00288        }
00289 }
00290 /* }}} */
00291 
00292 /* {{{ proto bool apache_child_terminate(void)
00293    Terminate apache process after this request */
00294 PHP_FUNCTION(apache_child_terminate)
00295 {
00296 #ifndef MULTITHREAD
00297        if (AP(terminate_child)) {
00298               ap_child_terminate( ((request_rec *)SG(server_context)) );
00299               RETURN_TRUE;
00300        } else { /* tell them to get lost! */
00301               php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is disabled");
00302               RETURN_FALSE;
00303        }
00304 #else
00305               php_error_docref(NULL TSRMLS_CC, E_WARNING, "This function is not supported in this build");
00306               RETURN_FALSE;
00307 #endif
00308 }
00309 /* }}} */
00310 
00311 /* {{{ proto string apache_note(string note_name [, string note_value])
00312    Get and set Apache request notes */
00313 PHP_FUNCTION(apache_note)
00314 {
00315        char *note_name, *note_val = NULL;
00316        int note_name_len, note_val_len;
00317        char *old_val;
00318 
00319        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &note_name, &note_name_len, &note_val, &note_val_len) == FAILURE) {
00320               return;
00321        }
00322 
00323        old_val = (char *) table_get(((request_rec *)SG(server_context))->notes, note_name);
00324 
00325        if (note_val) {
00326               table_set(((request_rec *)SG(server_context))->notes, note_name, note_val);
00327        }
00328 
00329        if (old_val) {
00330               RETURN_STRING(old_val, 1);
00331        }
00332 
00333        RETURN_FALSE;
00334 }
00335 /* }}} */
00336 
00337 /* {{{ proto bool virtual(string filename)
00338    Perform an Apache sub-request */
00339 /* This function is equivalent to <!--#include virtual...-->
00340  * in mod_include. It does an Apache sub-request. It is useful
00341  * for including CGI scripts or .shtml files, or anything else
00342  * that you'd parse through Apache (for .phtml files, you'd probably
00343  * want to use <?Include>. This only works when PHP is compiled
00344  * as an Apache module, since it uses the Apache API for doing
00345  * sub requests.
00346  */
00347 PHP_FUNCTION(virtual)
00348 {
00349        char *filename;
00350        int filename_len;
00351        request_rec *rr = NULL;
00352 
00353        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
00354               return;
00355        }
00356        
00357        if (!(rr = sub_req_lookup_uri (filename, ((request_rec *) SG(server_context))))) {
00358               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - URI lookup failed", filename);
00359               if (rr)
00360                      destroy_sub_req (rr);
00361               RETURN_FALSE;
00362        }
00363 
00364        if (rr->status != 200) {
00365               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - error finding URI", filename);
00366               if (rr)
00367                      destroy_sub_req (rr);
00368               RETURN_FALSE;
00369        }
00370 
00371        php_end_ob_buffers(1 TSRMLS_CC);
00372        php_header(TSRMLS_C);
00373 
00374        if (run_sub_req(rr)) {
00375               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to include '%s' - request execution failed", filename);
00376               if (rr)
00377                      destroy_sub_req (rr);
00378               RETURN_FALSE;
00379        }
00380 
00381        if (rr)
00382               destroy_sub_req (rr);
00383 
00384        RETURN_TRUE;
00385 }
00386 /* }}} */
00387 
00388 /* {{{ proto array getallheaders(void)
00389    Alias for apache_request_headers() */
00390 /* }}} */
00391 
00392 /* {{{ proto array apache_request_headers(void)
00393    Fetch all HTTP request headers */
00394 PHP_FUNCTION(apache_request_headers)
00395 {
00396        array_header *env_arr;
00397        table_entry *tenv;
00398        int i;
00399 
00400        array_init(return_value);
00401        env_arr = table_elts(((request_rec *) SG(server_context))->headers_in);
00402        tenv = (table_entry *)env_arr->elts;
00403        for (i = 0; i < env_arr->nelts; ++i) {
00404               if (!tenv[i].key ||
00405                      (PG(safe_mode) &&
00406                       !strncasecmp(tenv[i].key, "authorization", 13))) {
00407                      continue;
00408               }
00409               if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
00410                      RETURN_FALSE;
00411               }
00412     }
00413 }
00414 /* }}} */
00415 
00416 /* {{{ proto array apache_response_headers(void)
00417    Fetch all HTTP response headers */
00418 PHP_FUNCTION(apache_response_headers)
00419 {
00420        array_header *env_arr;
00421        table_entry *tenv;
00422        int i;
00423 
00424        array_init(return_value);
00425        env_arr = table_elts(((request_rec *) SG(server_context))->headers_out);
00426        tenv = (table_entry *)env_arr->elts;
00427        for (i = 0; i < env_arr->nelts; ++i) {
00428               if (!tenv[i].key) continue;
00429               if (add_assoc_string(return_value, tenv[i].key, (tenv[i].val==NULL) ? "" : tenv[i].val, 1)==FAILURE) {
00430                      RETURN_FALSE;
00431               }
00432        }
00433 }
00434 /* }}} */
00435 
00436 /* {{{ proto bool apache_setenv(string variable, string value [, bool walk_to_top])
00437    Set an Apache subprocess_env variable */
00438 PHP_FUNCTION(apache_setenv)
00439 {
00440        int var_len, val_len;
00441        zend_bool top=0;
00442        char *var = NULL, *val = NULL;
00443        request_rec *r = (request_rec *) SG(server_context);
00444 
00445        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
00446               return;
00447        }
00448 
00449        while(top) {
00450               if(r->prev) r = r->prev;
00451               else break;
00452        }
00453 
00454        ap_table_setn(r->subprocess_env, ap_pstrndup(r->pool, var, var_len), ap_pstrndup(r->pool, val, val_len));
00455        RETURN_TRUE;
00456 }
00457 /* }}} */
00458 
00459 /* {{{ proto object apache_lookup_uri(string URI)
00460    Perform a partial request of the given URI to obtain information about it */
00461 PHP_FUNCTION(apache_lookup_uri)
00462 {
00463        char *filename;
00464        int filename_len;
00465        request_rec *rr=NULL;
00466 
00467        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
00468               return;
00469        }
00470 
00471        if (!(rr = sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
00472               php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed '%s'", filename);
00473               RETURN_FALSE;
00474        }
00475 
00476        object_init(return_value);
00477        add_property_long(return_value,"status", rr->status);
00478 
00479        if (rr->the_request) {
00480               add_property_string(return_value,"the_request", rr->the_request, 1);
00481        }
00482        if (rr->status_line) {
00483               add_property_string(return_value,"status_line", (char *)rr->status_line, 1);        
00484        }
00485        if (rr->method) {
00486               add_property_string(return_value,"method", (char *)rr->method, 1);           
00487        }
00488        if (rr->content_type) {
00489               add_property_string(return_value,"content_type", (char *)rr->content_type, 1);
00490        }
00491        if (rr->handler) {
00492               add_property_string(return_value,"handler", (char *)rr->handler, 1);         
00493        }
00494        if (rr->uri) {
00495               add_property_string(return_value,"uri", rr->uri, 1);
00496        }
00497        if (rr->filename) {
00498               add_property_string(return_value,"filename", rr->filename, 1);
00499        }
00500        if (rr->path_info) {
00501               add_property_string(return_value,"path_info", rr->path_info, 1);
00502        }
00503        if (rr->args) {
00504               add_property_string(return_value,"args", rr->args, 1);
00505        }
00506        if (rr->boundary) {
00507               add_property_string(return_value,"boundary", rr->boundary, 1);
00508        }
00509 
00510        add_property_long(return_value,"no_cache", rr->no_cache);
00511        add_property_long(return_value,"no_local_copy", rr->no_local_copy);
00512        add_property_long(return_value,"allowed", rr->allowed);
00513        add_property_long(return_value,"sent_bodyct", rr->sent_bodyct);
00514        add_property_long(return_value,"bytes_sent", rr->bytes_sent);
00515        add_property_long(return_value,"byterange", rr->byterange);
00516        add_property_long(return_value,"clength", rr->clength);
00517 
00518 #if MODULE_MAGIC_NUMBER >= 19980324
00519        if (rr->unparsed_uri) {
00520               add_property_string(return_value,"unparsed_uri", rr->unparsed_uri, 1);
00521        }
00522        if(rr->mtime) {
00523               add_property_long(return_value,"mtime", rr->mtime);
00524        }
00525 #endif
00526        if(rr->request_time) {
00527               add_property_long(return_value,"request_time", rr->request_time);
00528        }
00529 
00530        destroy_sub_req(rr);
00531 }
00532 /* }}} */
00533 
00534 
00535 #if 0
00536 This function is most likely a bad idea.  Just playing with it for now.
00537 
00538 PHP_FUNCTION(apache_exec_uri)
00539 {
00540        char *filename;
00541        int filename_len;
00542        request_rec *rr=NULL;
00543        TSRMLS_FETCH();
00544 
00545        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
00546               return;
00547        }
00548 
00549        if(!(rr = ap_sub_req_lookup_uri(filename, ((request_rec *) SG(server_context))))) {
00550               php_error_docref(NULL TSRMLS_CC, E_WARNING, "URI lookup failed", filename);
00551               RETURN_FALSE;
00552        }
00553 
00554        RETVAL_LONG(ap_run_sub_req(rr));
00555        ap_destroy_sub_req(rr);
00556 }
00557 #endif
00558 
00559 /* {{{ proto string apache_get_version(void)
00560    Fetch Apache version */
00561 PHP_FUNCTION(apache_get_version)
00562 {
00563        char *apv = (char *) ap_get_server_version();
00564 
00565        if (apv && *apv) {
00566               RETURN_STRING(apv, 1);
00567        }
00568 
00569        RETURN_FALSE;
00570 }
00571 /* }}} */
00572 
00573 /* {{{ proto array apache_get_modules(void)
00574    Get a list of loaded Apache modules */
00575 PHP_FUNCTION(apache_get_modules)
00576 {
00577        int n;
00578        char *p;
00579        
00580        array_init(return_value);
00581        
00582        for (n = 0; ap_loaded_modules[n]; ++n) {
00583               char *s = (char *) ap_loaded_modules[n]->name;
00584               if ((p = strchr(s, '.'))) {
00585                      add_next_index_stringl(return_value, s, (p - s), 1);
00586               } else {
00587                      add_next_index_string(return_value, s, 1);
00588               }      
00589        }
00590 }
00591 /* }}} */
00592 
00593 /* {{{ proto bool apache_reset_timeout(void)
00594    Reset the Apache write timer */
00595 PHP_FUNCTION(apache_reset_timeout)
00596 {
00597        if (PG(safe_mode)) {
00598               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot reset the Apache timeout in safe mode");
00599               RETURN_FALSE;
00600        }
00601 
00602        ap_reset_timeout((request_rec *)SG(server_context));
00603        RETURN_TRUE;
00604 }
00605 /* }}} */
00606 
00607 /*
00608  * Local variables:
00609  * tab-width: 4
00610  * c-basic-offset: 4
00611  * End:
00612  * vim600: sw=4 ts=4 fdm=marker
00613  * vim<600: sw=4 ts=4
00614  */