本文整理匯總了PHP中WhatsProt::disconnect方法的典型用法代碼示例。如果您正苦於以下問題:PHP WhatsProt::disconnect方法的具體用法?PHP WhatsProt::disconnect怎麽用?PHP WhatsProt::disconnect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WhatsProt
的用法示例。
在下文中一共展示了WhatsProt::disconnect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onSyncResult
$w->sendMessage($msg['Dest_CtyCode'] . $msg['Dest_Number'], $msg['Dest_Message']);
mysql_query("INSERT INTO `OutMessageCompleted` (Job_ID, Job_Time, Job_Type, Dest_CtyCode, Dest_Number, Dest_Message) VALUES (NULL, NULL, 'WA', '" . $msg['Dest_CtyCode'] . "', '" . $msg['Dest_Number'] . "', '" . $msg['Dest_Message'] . "')");
mysql_query("DELETE FROM `OutMessageQueue` WHERE Job_ID='" . $msg['Job_ID'] . "'");
}
/******
mysql_query("INSERT INTO `messages` VALUES (NULL, NOW(), 'WA-API', '$dnum', '$dmsg')");
$gc = getGroupChats();
while ($row = mysql_fetch_array($gc)) {
$dnum=$row['group_code'];
echo 'Send to: '.$dnum . '#'. $dmsg."\n";
mysql_query("INSERT INTO `messages` VALUES (NULL, NOW(), 'WA-API', '".$row['group_names']."', '$dmsg')");
$w->sendMessage($dnum, $dmsg);
*********/
}
//for loop
$w->disconnect();
echo "Disconnected. Bye! :D\n";
die;
function onSyncResult($result)
{
foreach ($result->existing as $number) {
global $existUser;
$existUser = true;
}
}
function onGetGroupV2Info($mynumber, $group_id, $creator, $creation, $subject, $participants, $admins, $fromGetGroup)
{
$select = "SELECT group_names FROM `WAGroupChats` WHERE group_code='{$group_id}'";
$row = mysql_fetch_array(mysql_query($select));
if ($row) {
mysql_query("UPDATE WAGroupChats SET group_names='{$subject}' WHERE group_code='{$group_id}'");
示例2: __destruct
/**
* Cleanly disconnect from Whatsapp.
*
* Ensure at end of script, if a connected had been made
* to the whatsapp servers, that it is nicely terminated.
*
* @return void
*/
public function __destruct()
{
if (isset($this->wa) && $this->connected) {
$this->wa->disconnect();
}
}