summaryrefslogtreecommitdiff
path: root/sapi/apache2filter
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-12-27 22:47:06 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-12-27 22:47:06 +0000
commit648dd88b42ffeda9922611a7ce7e83416382c381 (patch)
treea38b8deae950a28cb84e3ed44797dc45c10708ec /sapi/apache2filter
parent572394db74cef01dbc7ab0a6bb3dada25b730f0a (diff)
downloadphp-git-648dd88b42ffeda9922611a7ce7e83416382c381.tar.gz
Added apache_get_version() & apache_get_modules() to Apache 1.X & Apache
Hooks sapis. Made the module listing in Apache 2 not show the '.c' portion, to be consistent with Apache 1.X.
Diffstat (limited to 'sapi/apache2filter')
-rw-r--r--sapi/apache2filter/php_functions.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c
index 4959fb91c7..a87e38e5f0 100644
--- a/sapi/apache2filter/php_functions.c
+++ b/sapi/apache2filter/php_functions.c
@@ -314,11 +314,17 @@ PHP_FUNCTION(apache_get_version)
PHP_FUNCTION(apache_get_modules)
{
int n;
+ char *p;
array_init(return_value);
for (n = 0; ap_loaded_modules[n]; ++n) {
- add_next_index_string(return_value, (char *) ap_loaded_modules[n]->name, 1);
+ char *s = (char *) ap_loaded_modules[n]->name;
+ if ((p = strchr(s, '.'))) {
+ add_next_index_stringl(return_value, s, (p - s), 1);
+ } else {
+ add_next_index_string(return_value, s, 1);
+ }
}
}
/* }}} */
@@ -328,9 +334,15 @@ PHP_MINFO_FUNCTION(apache)
char *apv = php_apache_get_version();
smart_str tmp1 = {0};
int n;
+ char *p;
for (n = 0; ap_loaded_modules[n]; ++n) {
- smart_str_appends(&tmp1, ap_loaded_modules[n]->name);
+ char *s = (char *) ap_loaded_modules[n]->name;
+ if ((p = strchr(s, '.'))) {
+ smart_str_appendl(&tmp1, s, (p - s));
+ } else {
+ smart_str_appends(&tmp1, s);
+ }
smart_str_appendc(&tmp1, ' ');
}
@@ -338,7 +350,7 @@ PHP_MINFO_FUNCTION(apache)
if (apv && *apv) {
php_info_print_table_row(2, "Apache Version", apv);
}
- php_info_print_table_row(2, "Loaded Apache Modules", tmp1.c);
+ php_info_print_table_row(2, "Loaded Modules", tmp1.c);
smart_str_free(&tmp1);
php_info_print_table_end();
}