Hi.
Can someone point me to where or how PHP DOESN'T close persistent
connections (those opened using mysql_pconnect()) when mysql_close()
is called with that connection.
Sorry to ask such an obvious question, but I'm not seeing it.
Thank you.
--
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
Richard Quadling a écrit :
Can someone point me to where or how PHP DOESN'T close persistent
connections
Maybe because it is... persistent ?
(those opened using mysql_pconnect()) when mysql_close()
is called with that connection.
See http://php.net/mysql_pconnect
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
Richard Quadling a écrit :
Can someone point me to where or how PHP DOESN'T close persistent
connectionsMaybe because it is... persistent ?
He's probably trying to learn how to do the same. This is internals
after all and not php-general.
Cheers,
Rob.
http://www.interjinn.com
Application and Templating Framework for PHP
Robert Cummings a écrit :
He's probably trying to learn how to do the same. This is internals
after all and not php-general.
Sorry for the private mail, I did't see you sent here too.
It is in the documentation that mysql_close don't close a mysql_pconnect.
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
Richard Quadling a écrit :
Can someone point me to where or how PHP DOESN'T close persistent
connectionsMaybe because it is... persistent ?
He's probably trying to learn how to do the same. This is internals
after all and not php-general.
If you'd like to peruse the source, to implement a similar feature,
one place to look is the web gui to CVS for the function:
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?
revision=1.213.2.6.2.16.2.26&view=markup
-Bop
2008/8/30 Ronald Chmara ron@opus1.com:
Richard Quadling a écrit :
Can someone point me to where or how PHP DOESN'T close persistent
connectionsMaybe because it is... persistent ?
He's probably trying to learn how to do the same. This is internals
after all and not php-general.If you'd like to peruse the source, to implement a similar feature, one
place to look is the web gui to CVS for the function:http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?revision=1.213.2.6.2.16.2.26&view=markup
-Bop
What I'm trying to determine is how persistent connections are ignored
when mysql_close() is called against a connection which was opened via
mysql_pconnect().
I've looked at the source and can see that mysql_connect and
mysql_pconnect call
php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, x); where x is
1 or 0 (persistent or not).
But in mysql_close(), there is no reference to the persistent setting
of MySG(allow_persistent) or any other persistent related variable.
So, I'm missing something. And that's why I asked.
Regards,
Richard Quadling.
--
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
What I'm trying to determine is how persistent connections are ignored
when mysql_close() is called against a connection which was opened via
mysql_pconnect().I've looked at the source and can see that mysql_connect and
mysql_pconnect call
php_mysql_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, x); where x is
1 or 0 (persistent or not).But in mysql_close(), there is no reference to the persistent setting
of MySG(allow_persistent) or any other persistent related variable.So, I'm missing something. And that's why I asked.
From my browsing of the code, specifically related to following the
"persistent" var, it appears that php_mysql_do_connect() doesn't add it
to the resource list of normal connections when the connection is
created. As such it wouldn't get closed if you attempted to close it.
Cheers,
Rob.
http://www.interjinn.com
Application and Templating Framework for PHP