cvs: php4 /ext/standard info.c

From: Date: Wed, 19 Jun 2002 13:24:01 +0000
Subject: cvs: php4 /ext/standard info.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12417@lists.php.net to get a copy of this message
sander Wed Jun 19 09:24:02 2002 EDT Modified files: /php4/ext/standard info.c Log: Made the API versions appear better on phpinfo(); Index: php4/ext/standard/info.c diff -u php4/ext/standard/info.c:1.182 php4/ext/standard/info.c:1.183 --- php4/ext/standard/info.c:1.182 Sat Jun 8 06:25:44 2002 +++ php4/ext/standard/info.c Wed Jun 19 09:24:01 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c,v 1.182 2002/06/08 10:25:44 mfischer Exp $ */ +/* $Id: info.c,v 1.183 2002/06/19 13:24:01 sander Exp $ */ #include "php.h" #include "php_ini.h" @@ -208,18 +208,11 @@ int expose_php = INI_INT("expose_php"); time_t the_time; struct tm *ta, tmbuf; - char php_api_no[9]; - char mod_api_no[9]; - char ext_api_no[9]; the_time = time(NULL); ta = php_localtime_r(&the_time, &tmbuf); - snprintf (php_api_no, 9, "%d", PHP_API_VERSION); - snprintf (mod_api_no, 9, "%d", ZEND_MODULE_API_NO); - snprintf (ext_api_no, 9, "%d", ZEND_EXTENSION_API_NO); - PUTS("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n"); PUTS("<head>"); php_info_print_style(); @@ -227,6 +220,7 @@ if (flag & PHP_INFO_GENERAL) { char *zend_version = get_zend_version(); + char *api_numbers; php_uname = php_get_uname('a'); @@ -261,10 +255,11 @@ #endif php_info_print_table_row(2, "Configuration File (php.ini) Path", php_ini_opened_path?php_ini_opened_path:PHP_CONFIG_FILE_PATH); - - php_info_print_table_row(2, "PHP API No.", php_api_no); - php_info_print_table_row(2, "PHP Extensions API No.", mod_api_no); - php_info_print_table_row(2, "Zend Extensions API No.", ext_api_no); + + api_numbers = emalloc(sizeof("PHP: \nPHP Extension: \nZend Extension: ") + 3*8); + snprintf(api_numbers, sizeof("PHP: \nPHP Extension: \nZend Extension: ") + 3*8, "PHP: %d\nPHP Extension: %d\nZend Extension: %d", PHP_API_VERSION, ZEND_MODULE_API_NO, ZEND_EXTENSION_API_NO); + php_info_print_table_row(2, "API Versions:", api_numbers); + efree(api_numbers); #if ZEND_DEBUG php_info_print_table_row(2, "Debug Build", "yes" );

« previous php.cvs (#12417) next »