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