php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #44155 pdo_drivers() not documented
Submitted: 2008-02-18 18:32 UTC Modified: 2008-11-07 11:59 UTC
From: uwendel at mysql dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2008-02-18 18:32 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-18 19:08 UTC] 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 22:40 UTC] 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-11-07 11:59 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

I've documented it as an alias of PDO::getAvailableDrivers().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC