MysqlndUhConnection::getThreadId
(PECL mysqlnd-uh >= 1.0.0-alpha)
MysqlndUhConnection::getThreadId — Retourne l'identifiant du thread pour la connexion courante
Description
public int MysqlndUhConnection::getThreadId
( mysqlnd_connection
$connection
)Retourne l'identifiant du thread de la connexion courante.
Liste de paramètres
-
connection
-
Le gestionnaire de connexion Mysqlnd. Ne pas modifier !
Valeurs de retour
L'identifiant du thread de la connexion.
Exemples
Exemple #1 Exemple avec MysqlndUhConnection::getThreadId()
- <?php
- class proxy extends MysqlndUhConnection {
- public function getThreadId($res) {
- printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
- $ret = parent::getThreadId($res);
- printf("%s retourne %s\n", __METHOD__, var_export($ret, true));
- return $ret;
- }
- }
- mysqlnd_uh_set_connection_proxy(new proxy());
- $mysqli = new mysqli("localhost", "root", "", "test");
- var_dump($mysqli->thread_id);
- ?>
L'exemple ci-dessus va afficher :
proxy::getThreadId(array ( 0 => NULL, )) proxy::getThreadId retourne 27646 int(27646)
Voir aussi
- mysqlnd_uh_set_connection_proxy() - Installe un proxy pour les connexions mysqlnd
- mysqli_thread_id() - Retourne l'identifiant du thread pour la connexion courante
- mysql_thread_id() - Retourne l'identifiant du thread MySQL courant