本文整理匯總了PHP中connect::sendMenu方法的典型用法代碼示例。如果您正苦於以下問題:PHP connect::sendMenu方法的具體用法?PHP connect::sendMenu怎麽用?PHP connect::sendMenu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類connect
的用法示例。
在下文中一共展示了connect::sendMenu方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: trim
if ($out === false) {
break;
}
$out = trim($out);
processResponse($out);
}
if (date('Y-m-d H:i:s') != $last_echo) {
$last_echo = date('Y-m-d H:i:s');
echo $last_echo . " Listening...\n";
}
if (time() - $menu_sent_time > 30 * 60) {
echo "Updating full menu\n";
$sqlQuery = "SELECT *\n FROM commands";
$menu_sent_time = time();
if ($socket_connected) {
$connect->sendMenu(1);
}
$commands = SQLSelect($sqlQuery);
$total = count($commands);
for ($i = 0; $i < $total; $i++) {
$cmd_values[$commands[$i]['ID']] = $commands[$i]['CUR_VALUE'];
$cmd_titles[$commands[$i]['ID']] = $commands[$i]['RENDER_TITLE'];
$cmd_data[$commands[$i]['ID']] = $commands[$i]['RENDER_DATA'];
}
}
if (time() - $checked_time > 10) {
$checked_time = time();
// update data
$sqlQuery = "SELECT *\n FROM commands\n WHERE AUTO_UPDATE > 0\n AND (NOW() - RENDER_UPDATED) > AUTO_UPDATE";
$commands = SQLSelect($sqlQuery);
$total = count($commands);