MysqlndUhConnection::killConnection
(PECL mysqlnd-uh >= 1.0.0-alpha)
MysqlndUhConnection::killConnection — Demande au serveur de tuer un thread MySQL
Description
public bool MysqlndUhConnection::killConnection
( mysqlnd_connection
$connection
, int $pid
)Demande au serveur de tuer un thread MySQL.
Liste de paramètres
-
connection -
Le gestionnaire de connexion Mysqlnd. Ne pas modifier !
-
pid -
L'identifiant du thread de connexion à tuer.
Valeurs de retour
Retourne TRUE en cas de succès.
Sinon, retourne FALSE
Exemples
Exemple #1 Exemple avec MysqlndUhConnection::kill()
<?php
class proxy extends MysqlndUhConnection {
public function killConnection($res, $pid) {
printf("%s(%s)\n", __METHOD__, var_export(func_get_args(), true));
$ret = parent::killConnection($res, $pid);
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");
$mysqli->kill($mysqli->thread_id);
?>L'exemple ci-dessus va afficher :
proxy::killConnection(array ( 0 => NULL, 1 => 27650, )) proxy::killConnection retourne true
Voir aussi
- mysqlnd_uh_set_connection_proxy() - Installe un proxy pour les connexions mysqlnd
- mysqli_kill() - Demande au serveur de terminer un thread MySQL
