#44155 [Opn->Asn]: pdo_drivers() not documented
| From: | kalle@php.net | Date: | Tue, 22 Jul 2008 13:02:39 +0000 |
| Subject: | #44155 [Opn->Asn]: pdo_drivers() not documented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-989@lists.php.net to get a copy of this message | ||
ID: 44155
Updated by: kalle@php.net
Reported By: uwendel at mysql dot com
-Status: Open
+Status: Assigned
Bug Type: Documentation problem
Operating System: Linux
PHP Version: Irrelevant
-Assigned To:
+Assigned To: kalle
Previous Comments:
------------------------------------------------------------------------
[2008-02-18 22:40:19] uw@php.net
Well, yes, I know that PDO::getAvailableDrivers() is documented. But I
wonder what to do with pdo_drivers(): document and test or ignore. Maybe
a PDO hacker can hook in and comment.
PS: would be nice if one could prioritize "bugs". This is definetly a
low-priority feature request.
------------------------------------------------------------------------
[2008-02-18 19:08:50] philip@php.net
It's documented, sort of, but this bug is still open:
http://docs.php.net/manual/en/pdo.getavailabledrivers.php
Looks like the function was added, removed in favour of method only,
then added again.
------------------------------------------------------------------------
[2008-02-18 18:32:04] uwendel at mysql dot com
Description:
------------
pdo_drivers() is not documented as it seems,
http://de.php.net/manual-lookup.php?pattern=pdo_drivers&lang=en
Please document or remove it.
ext/pdo/pdo.c
/* {{{ 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);
}
}
/* }}} */
Reproduce code:
---------------
nixnutz@ulflinux:~/php53> sapi/cli/php -r "var_dump(pdo_drivers());"
array(3) {
[0]=>
string(7) "sqlite2"
[1]=>
string(6) "sqlite"
[2]=>
string(5) "mysql"
}
Expected result:
----------------
Well, result is fine. It should be documented that's all.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44155&edit=1