本文整理汇总了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));
}
}