17#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
32#include "apr_strings.h"
35#include "util_filter.h"
37#include "http_config.h"
38#include "http_request.h"
40#include "http_protocol.h"
43#include "util_script.h"
54int php_apache2_info_id;
59#define SECTION(name) PUTS("<h2>" name "</h2>\n")
61static request_rec *php_apache_lookup_uri(
char *filename)
65 if (!filename || !ctx || !ctx->
r) {
69 return ap_sub_req_lookup_uri(filename, ctx->
r, ctx->
r->output_filters);
83 if (!(rr = php_apache_lookup_uri(filename))) {
88 if (rr->status != HTTP_OK) {
90 ap_destroy_sub_req(rr);
102 if (ap_run_sub_req(rr)) {
104 ap_destroy_sub_req(rr);
107 ap_destroy_sub_req(rr);
112#define ADD_LONG(name) \
113 add_property_long(return_value, #name, rr->name)
114#define ADD_TIME(name) \
115 add_property_long(return_value, #name, apr_time_sec(rr->name));
116#define ADD_STRING(name) \
117 if (rr->name) add_property_string(return_value, #name, (char *) rr->name)
129 if (!(rr = php_apache_lookup_uri(filename))) {
134 if (rr->status == HTTP_OK) {
160 ap_destroy_sub_req(rr);
165 ap_destroy_sub_req(rr);
173 const apr_array_header_t *arr;
182 ctx =
SG(server_context);
183 arr = apr_table_elts(ctx->
r->headers_in);
196 const apr_array_header_t *arr;
205 ctx =
SG(server_context);
206 arr = apr_table_elts(ctx->
r->headers_out);
219 char *note_name, *note_val =
NULL;
220 size_t note_name_len, note_val_len;
221 char *old_note_val=
NULL;
227 ctx =
SG(server_context);
229 old_note_val = (
char *) apr_table_get(ctx->
r->notes, note_name);
232 apr_table_set(ctx->
r->notes, note_name, note_val);
250 char *variable=
NULL, *string_val=
NULL;
251 size_t variable_len, string_val_len;
252 bool walk_to_top = 0;
260 ctx =
SG(server_context);
263 if (arg_count == 3) {
271 apr_table_set(r->subprocess_env, variable, string_val);
286 bool walk_to_top = 0;
295 ctx =
SG(server_context);
298 if (arg_count == 2) {
306 env_val = (
char*) apr_table_get(r->subprocess_env, variable);
308 if (env_val !=
NULL) {
316static const char *php_apache_get_version(
void)
318 return ap_get_server_banner();
324 const char *apv = php_apache_get_version();
342 for (
n = 0; ap_loaded_modules[
n]; ++
n) {
343 const char *
s = ap_loaded_modules[
n]->name;
355 const char *apv = php_apache_get_version();
360 server_rec *serv = ((
php_struct *)
SG(server_context))->r->server;
362 AP_DECLARE_DATA
extern unixd_config_rec ap_unixd_config;
365 for (
n = 0; ap_loaded_modules[
n]; ++
n) {
366 const char *
s = ap_loaded_modules[
n]->name;
368 smart_str_appendc(&
tmp1,
' ');
371 smart_str_appendl(&
tmp1,
s, (
p -
s));
373 smart_str_appends(&
tmp1,
s);
377 smart_str_appendc(&
tmp1,
'/');
385 snprintf(tmp,
sizeof(tmp),
"%d", MODULE_MAGIC_NUMBER_MAJOR);
388 if (serv->server_admin && *(serv->server_admin)) {
392 snprintf(tmp,
sizeof(tmp),
"%s:%u", serv->server_hostname, serv->port);
396 snprintf(tmp,
sizeof(tmp),
"%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
400 ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, &max_requests);
401 snprintf(tmp,
sizeof(tmp),
"Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ?
"on":
"off"), serv->keep_alive_max);
404 apr_snprintf(tmp,
sizeof tmp,
405 "Connection: %" APR_TIME_T_FMT
" - Keep-Alive: %" APR_TIME_T_FMT,
406 apr_time_sec(serv->timeout), apr_time_sec(serv->keep_alive_timeout));
413 smart_str_free(&
tmp1);
419 const apr_array_header_t *arr = apr_table_elts(((
php_struct *)
SG(server_context))->r->subprocess_env);
434 SECTION(
"HTTP Headers Information");
439 arr = apr_table_elts(((
php_struct *)
SG(server_context))->r->headers_in);
448 arr = apr_table_elts(((
php_struct *)
SG(server_context))->r->headers_out);
strchr(string $haystack, string $needle, bool $before_needle=false)
PHPAPI bool php_header(void)
PHPAPI ZEND_COLD void php_info_print_table_colspan_header(int num_cols, const char *header)
PHPAPI ZEND_COLD void php_info_print_table_header(int num_cols,...)
PHPAPI ZEND_COLD void php_error_docref(const char *docref, int type, const char *format,...)
PHPAPI void php_output_end_all(void)
php_info_print_table_start()
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end()
#define PHP_MSHUTDOWN_FUNCTION
#define PHP_MINIT_FUNCTION
#define PHP_MINFO_FUNCTION
#define APR_ARRAY_FOREACH_CLOSE()
#define APR_ARRAY_FOREACH_OPEN(arr, key, val)
php_apache2_info_struct php_apache2_info
zend_module_entry php_apache_module
apache_lookup_uri(string $filename)
apache_response_headers()
apache_getenv(string $variable, bool $walk_to_top=false)
apache_note(string $note_name, ?string $note_value=null)
apache_setenv(string $variable, string $value, bool $walk_to_top=false)
#define STD_PHP_INI_BOOLEAN
unsigned char key[REFLECTION_KEY_LEN]
ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t length)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API zend_result add_next_index_string(zval *arg, const char *str)
ZEND_API void object_init(zval *arg)
#define zend_parse_parameters_none()
#define UNREGISTER_INI_ENTRIES()
#define REGISTER_INI_ENTRIES()
#define DISPLAY_INI_ENTRIES()
#define STANDARD_MODULE_HEADER
struct _zend_module_entry zend_module_entry
#define STANDARD_MODULE_PROPERTIES
fbc internal_function handler(call, ret)