截至 8.0.17 版,Session::listClients() 方法尚未實作。(沒有可用的版本資訊,可能僅存在於 Git 中)
Session::listClients — 取得用戶端列表
此函式沒有參數。
一個包含目前已登入的用戶端的陣列。陣列元素為 "client_id"、"user"、"host" 和 "sql_session"。
範例 #1 mysql_xdevapi\Session::listClients() 範例
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$ids = $session->listClients();
var_dump($ids);
?>上述範例會輸出類似如下的內容
array(1) {
[0]=>
array(4) {
["client_id"]=>
int(61)
["user"]=>
string(4) "root"
["host"]=>
string(9) "localhost"
["sql_session"]=>
int(72)
}
}