PHP_FUNCTION(apache_lookup_uri);
PHP_FUNCTION(apache_child_terminate);
PHP_FUNCTION(apache_setenv);
+PHP_FUNCTION(apache_get_version);
PHP_MINFO_FUNCTION(apache);
PHP_FE(apache_child_terminate, NULL)
PHP_FE(apache_setenv, NULL)
PHP_FE(apache_response_headers, NULL)
+ PHP_FE(apache_get_version, NULL)
PHP_FALIAS(getallheaders, apache_request_headers, NULL)
{NULL, NULL, NULL}
};
apache_globals->in_request = 0;
}
-
static PHP_MINIT_FUNCTION(apache)
{
#ifdef ZTS
*/
PHP_MINFO_FUNCTION(apache)
{
+ char *apv = (char *) ap_get_server_version();
module *modp = NULL;
char output_buf[128];
#if !defined(WIN32) && !defined(WINNT)
serv = ((request_rec *) SG(server_context))->server;
-
php_info_print_table_start();
#ifdef PHP_WIN32
php_info_print_table_row(2, "APACHE_TARGET", PHP_APACHE_TARGET);
#endif
- php_info_print_table_row(2, "Apache Version", SERVER_VERSION);
+ if (apv && *apv) {
+ php_info_print_table_row(2, "Apache Version", apv);
+ }
#ifdef APACHE_RELEASE
sprintf(output_buf, "%d", APACHE_RELEASE);
}
/* }}} */
+/* {{{ proto string apache_get_version(void)
+ Fetch Apache version */
+PHP_FUNCTION(apache_get_version)
+{
+ char *apv = (char *) ap_get_server_version();
+
+ if (apv && *apv) {
+ RETURN_STRING(apv, 1);
+ } else {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
#if 0
This function is most likely a bad idea. Just playing with it for now.