summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-22 10:26:51 (GMT)
committerMarcus Boerger <helly@php.net>2005-03-22 10:26:51 (GMT)
commit73a6a3105354578e3ba33184640479dda8d9d8bb (patch)
tree63cbacc4b2ad9cca23f4c222bf0ee8bc0de94a43 /ext
parentfedbd2145a2811182414acc089b7115965c3b849 (diff)
downloadphp-73a6a3105354578e3ba33184640479dda8d9d8bb.tar.gz
- the driver's key name is not zero terminated, hence we need to either
estrNcpy() it or use the driver struct. - table headers do not support single column mode so change to two cols - there should be only one table header
Diffstat (limited to 'ext')
-rwxr-xr-xext/pdo/pdo.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 409d193..c7d8413 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -378,20 +378,24 @@ PHP_RSHUTDOWN_FUNCTION(pdo)
PHP_MINFO_FUNCTION(pdo)
{
HashPosition pos;
- ulong num_key;
- char *name;
- int namelen;
+ char *drivers = NULL, *ldrivers = estrdup("");
+ pdo_driver_t **pdriver;
php_info_print_table_start();
- php_info_print_table_header(2, "pdo support", "enabled");
- php_info_print_table_header(1, "Available PDO Drivers");
+ php_info_print_table_header(2, "PDO support", "enabled");
zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos);
- while (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(&pdo_driver_hash, &name, &namelen, &num_key, 0, &pos)) {
- php_info_print_table_row(1, name);
+ while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) {
+ spprintf(&drivers, 0, "%s, %s", ldrivers, (*pdriver)->driver_name);
zend_hash_move_forward_ex(&pdo_driver_hash, &pos);
+ efree(ldrivers);
+ ldrivers = drivers;
}
+ php_info_print_table_row(2, "PDO drivers", drivers+2);
+
+ efree(drivers);
+
php_info_print_table_end();
#if 0