Edit report at http://bugs.php.net/bug.php?id=49280&edit=1
ID: 49280
Updated by: uw@php.net
Reported by: ar at ez dot no
Summary: ext/mysqlnd: Not possible to detect mysqlnd in php
Status: Wont fix
Type: Feature/Change Request
Package: MySQLi related
Operating System: *
PHP Version: 5.3.0
Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
How to detect the client library in use is described below: use the
existing API.
Previous Comments:
------------------------------------------------------------------------
[2011-01-06 15:55:22] pajoye@php.net
That's not pollution. We already had mysqlnd specific bugs or cases
where we would
have liked to detect at runtime which backend is used. That's a rather
common
need.
------------------------------------------------------------------------
[2011-01-06 15:52:10] uw@php.net
Not needed, pollution.
mysqli has client info, mysql has mysql_get_client_info(). With the
mysql[i] extensions the info which library is used can be retrieved with
a simple stristr() call using the API that is there to tell you the
client [library] version [string]: *_client_info(). Even stinky PDO has
a version string, although documented as int: PDO::ATTR_CLIENT_VERSION.
------------------------------------------------------------------------
[2011-01-06 15:21:37] pajoye@php.net
It could still be useful and won't hurt to have it.
------------------------------------------------------------------------
[2011-01-06 14:42:49] uw@php.net
Original issue was "bogus" (persistent connections).
Too few relevant differences between mysqlnd and libmysql otherwise and
none that you can't easily detect by e.g. using mysqli->client_info. No
need for an extra constant.
------------------------------------------------------------------------
[2009-08-17 17:28:58] ar at ez dot no
> And you really should be checking if mysql*.allow_persistent is
on or off anyway
We don't need hide php warnings, so if php trows a understandable
warning in such a case, then that would be sufficient.
So, for my use case this is not valid anymore then, Thanks;)
But as long as mysqlnd behaves differently then the old mysql client, I
would vote for such a constant anyway. Or you can close with reference
to the first comment(2:21) on how to detect mysqlnd if you absolutely
need to know about it in code.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=49280--
Edit this bug report at http://bugs.php.net/bug.php?id=49280&edit=1