ID: 49280
Comment by: ar at ez dot no
Reported By: ar at ez dot no
Status: Feedback
Bug Type: MySQLi related
Operating System: *
PHP Version: 5.3.0
New Comment:
Hi jani!
I'm not trying to workaround anything, its just that Persistent
Connections are only supported on mysqli when mysqlnd is used.
So it doesn't help to detect php version using PHP_VERSION, as the end
user might have mysqlnd disabled / not compiled in.
It is possible to detect it by by using function_exists. But since you
guys might add those extra mysqlnd functions to the other mysql driver
as well, that is not reliable not to mention clean.
see: http://no.php.net/mysqli.mysqlnd
For what I'm trying to do:
eZ Publish like other php projects abstracts things, one of those is
Persistent connection, witch is abstracted into a ini setting
(changeable in admin gui). So I need to prepend "p:" IF user has
mysqlnd, or trow a warning about unsupported setting.
Previous Comments:
------------------------------------------------------------------------
[2009-08-17 14:30:15] jani@php.net
So you want to circumvent a bug by adding a constant instead of fixing
the actual bug? Can you please explain WHAT does not work like it should
when you have enabled mysqlnd..?
------------------------------------------------------------------------
[2009-08-17 14:21:35] ar at ez dot no
Seems to be possible with something like this as well:
strpos( mysqli_get_client_info(), 'mysqlnd ' ) !== false
But constant would still be a bit cleaner.
------------------------------------------------------------------------
[2009-08-17 14:10:00] ar at ez dot no
Description:
------------
There doesn't seem to be possible to cleanly* detect that mysqlnd is
currently in use.
* Constant would be nice, preferably already in 5.3.next
Detecting by presence off 'mysqli_fetch_all' or other functions is not
exactly clean.
Use case: Disabling / enabling Persistent Connections based on
application specific settings.
See: http://issues.ez.no/IssueView.php?Id=15315
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49280&edit=1