summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-22 10:36:25 (GMT)
committerMarcus Boerger <helly@php.net>2005-03-22 10:36:25 (GMT)
commitdce82da87d42d1e8ca9cf2f9e88133605ace00b4 (patch)
treed36d02348fe821674f4963d2c067602da07f8852 /ext
parent73a6a3105354578e3ba33184640479dda8d9d8bb (diff)
downloadphp-dce82da87d42d1e8ca9cf2f9e88133605ace00b4.tar.gz
- Add function pdo_drivers()
Diffstat (limited to 'ext')
-rwxr-xr-xext/pdo/pdo.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index c7d8413..2c98403 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -62,8 +62,26 @@ PDO_API zend_class_entry *php_pdo_get_exception(void)
zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
+/* proto array pdo_drivers()
+ Return array of available PDO drivers */
+PHP_FUNCTION(pdo_drivers)
+{
+ HashPosition pos;
+ pdo_driver_t **pdriver;
+
+ array_init(return_value);
+
+ zend_hash_internal_pointer_reset_ex(&pdo_driver_hash, &pos);
+ while (SUCCESS == zend_hash_get_current_data_ex(&pdo_driver_hash, (void**)&pdriver, &pos)) {
+ add_next_index_stringl(return_value, (char*)(*pdriver)->driver_name, (*pdriver)->driver_name_len, 1);
+ zend_hash_move_forward_ex(&pdo_driver_hash, &pos);
+ }
+}
+/* }}} */
+
/* {{{ pdo_functions[] */
function_entry pdo_functions[] = {
+ PHP_FE(pdo_drivers, NULL)
{NULL, NULL, NULL}
};
/* }}} */