cvs: pecl /pdo pdo.c

From: Date: Tue, 22 Mar 2005 10:36:26 +0000
Subject: cvs: pecl /pdo pdo.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-2879@lists.php.net to get a copy of this message
helly Tue Mar 22 05:36:26 2005 EDT Modified files: /pecl/pdo pdo.c Log: - Add function pdo_drivers() http://cvs.php.net/diff.php/pecl/pdo/pdo.c?r1=1.46&r2=1.47&ty=u Index: pecl/pdo/pdo.c diff -u pecl/pdo/pdo.c:1.46 pecl/pdo/pdo.c:1.47 --- pecl/pdo/pdo.c:1.46 Tue Mar 22 05:26:51 2005 +++ pecl/pdo/pdo.c Tue Mar 22 05:36:25 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo.c,v 1.46 2005/03/22 10:26:51 helly Exp $ */ +/* $Id: pdo.c,v 1.47 2005/03/22 10:36:25 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -62,8 +62,26 @@ 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} }; /* }}} */

« previous php.pecl.cvs (#2879) next »