本文整理匯總了PHP中DBConnector::getVNC_ClientInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBConnector::getVNC_ClientInfo方法的具體用法?PHP DBConnector::getVNC_ClientInfo怎麽用?PHP DBConnector::getVNC_ClientInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBConnector
的用法示例。
在下文中一共展示了DBConnector::getVNC_ClientInfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: deleteInactiveVncWindow
protected function deleteInactiveVncWindow()
{
// print("\n[Daemon]: +++ TODO: deleteInactiveWindow() +++");
$db = new DBConnector();
// window_ids in db
$vnc_windows_in_db = array();
$client_info = $db->getVNC_ClientInfo();
foreach ($client_info as $info) {
$vnc_windows_in_db[] = $info["win_id"];
}
// window_ids on screen
$windows_on_screen = array();
$windows = explode("\n", shell_exec('wmctrl -l'));
foreach ($windows as $w) {
$field = explode(' ', $w);
$id = $field[0];
if ($id != '') {
$windows_on_screen[] = $id;
}
}
// print("[Daemon]: clients in db = " . serialize($vnc_windows_in_db));
// print("[Daemon]: client on screen = " . serialize($windows_on_screen));
// window_ids that are in the db, but not on the screen (window already closed)
$inactive_vnc_window_ids = array_diff($vnc_windows_in_db, $windows_on_screen);
foreach ($inactive_vnc_window_ids as $inactive_win_id) {
// define vnc-id
$inactive_vnc_id = $db->querySingle("SELECT file FROM window WHERE win_id='" . $inactive_win_id . "'");
// delete from database (send to control.php)
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => CONFIG_CONTROL_FILE_URL . '?window=vncwin&delete=VNC&vncid=' . $inactive_win_id, CURLOPT_USERAGENT => 'PalMA cURL Request'));
$resp = curl_exec($curl);
curl_close($curl);
// print("[Daemon]: inactive vnc_id = $inactive_vnc_id >> add to list: " .serialize($this->_IGNORE_LIST));
}
}