Add version info about run-time client library

# A number of user crashes appear to be caused
# by using incorrect combinations of libraries
This commit is contained in:
Ard Biesheuvel 2004-02-11 12:08:44 +00:00
parent 9925c63be5
commit a3dd0efee2

View File

@ -24,6 +24,10 @@
#include "config.h" #include "config.h"
#endif #endif
#ifdef __GNUC__
#define _GNU_SOURCE
#endif
#include "php.h" #include "php.h"
#define FILE_REVISION "$Revision$" #define FILE_REVISION "$Revision$"
@ -727,21 +731,50 @@ PHP_RSHUTDOWN_FUNCTION(ibase)
PHP_MINFO_FUNCTION(ibase) PHP_MINFO_FUNCTION(ibase)
{ {
char tmp[64]; char tmp[64], *s;
php_info_print_table_start(); php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled"); php_info_print_table_row(2, "Interbase Support", "enabled");
#if (SQLDA_CURRENT_VERSION > 1) || defined(FB_SQLDA) #ifdef FB_API_VER
isc_get_client_version(tmp); sprintf( (s = tmp), "Firebird API version %d", FB_API_VER);
php_info_print_table_row(2, "Client Library", tmp); #elif (SQLDA_CURRENT_VERSION > 1)
s = "Interbase 7.0 and up";
#elif (SQL_DIALECT_CURRENT == 1) #elif (SQL_DIALECT_CURRENT == 1)
php_info_print_table_row(2, "Client Library", "Interbase 5.6 or earlier"); s = "Interbase 5.6 or earlier";
#elif !defined(DSC_null) #elif !defined(DSC_null)
php_info_print_table_row(2, "Client Library", "Interbase 6"); s = "Interbase 6";
#else #else
php_info_print_table_row(2, "Client Library", "Firebird 1.0"); s = "Firebird 1.0";
#endif #endif
php_info_print_table_row(2, "Compile-time Client Library Version", s);
#if defined(__GNUC__) || defined(PHP_WIN32)
do {
#ifdef __GNUC__
void (*info_func)(char*) = dlsym(RTLD_DEFAULT, "isc_get_client_version");
#else
void (__stdcall *info_func)(char*) = NULL;
HMODULE l = GetModuleHandle("fbclient");
if (!l && !(l = GetModuleHandle("gds32"))) {
break;
}
info_func = (void (__stdcall *)(char*))GetProcAddress(l, "isc_get_client_version");
#endif
if (info_func) {
info_func(s = tmp);
} else {
#if HAVE_IBASE6_API
s = "Firebird 1.0/Interbase 6";
#else
s = "Firebird 1.0/Interbase 6 or earlier";
#endif
}
php_info_print_table_row(2, "Run-time Client Library Version", s);
} while (0);
#endif
php_info_print_table_row(2, "Revision", FILE_REVISION); php_info_print_table_row(2, "Revision", FILE_REVISION);
#ifdef COMPILE_DL_INTERBASE #ifdef COMPILE_DL_INTERBASE