本文整理匯總了PHP中HTTP::end方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTTP::end方法的具體用法?PHP HTTP::end怎麽用?PHP HTTP::end使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTTP
的用法示例。
在下文中一共展示了HTTP::end方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
<?php
require_once dirname(dirname(dirname(dirname(__DIR__)))) . '/Workerman/Autoloader.php';
require_once dirname(dirname(__DIR__)) . '/GatewayClient/Gateway.php';
\Workerman\Autoloader::setRootPath(__DIR__ . '/../../');
use GatewayWorker\Lib\Db;
use Workerman\Protocols\Http;
if (!isset($_POST['macid']) && !isset($_POST['buttonid'])) {
echo "對不起,您訪問的頁麵不存在!";
HTTP::end();
}
$macid = $_POST['macid'];
$buttonid = $_POST['buttonid'];
$connectHC = Db::instance('ConnectHC');
$clientdata = $connectHC->row("SELECT clientid, sign FROM `WEBHC` WHERE macid='{$macid}'");
if (!Gateway::isOnline($clientdata['clientid'])) {
echo "102";
HTTP::end();
}
if (!$clientdata['sign']) {
echo "103";
HTTP::end();
}
Gateway::sendToClient($clientdata['clientid'], "{" . $buttonid . "}");
echo "101";
HTTP::end();
?>
示例2: receiveEvent
/**
* 接收事件消息
* @var object
* @return string
*/
private function receiveEvent($object)
{
$result = "";
$client_openid = $object->FromUserName;
switch ($object->Event) {
//關注事件
case "subscribe":
$content = "感謝關注廣州匯承信息科技微信服務號! [太陽]\n\n";
$content .= "點擊菜單:'HC匯承'\n";
$content .= "得到最新產品谘詢、HC產品列表匯總、HC匯承官網信息\n";
$content .= "--------------------------\n";
$content .= "點擊菜單:'人工谘詢'\n";
$content .= "在線技術支持、在線銷售谘詢\n";
$content .= "--------------------------\n";
$content .= "點擊菜單:'HC智能❤'\n";
$content .= "暫時沒有開放..\n\n";
$content .= "電話:020-4008881803";
$result = $this->transmitText($object, $content);
break;
//取消關注事件
//取消關注事件
case "unsubscribe":
$content = "取消關注";
break;
/*case "SCAN":
$content = "掃描場景 ".$object->EventKey;
break;*/
//點擊事件
/*case "SCAN":
$content = "掃描場景 ".$object->EventKey;
break;*/
//點擊事件
case "CLICK":
switch ($object->EventKey) {
//最新產品
case "NewProduct":
$content = array();
$content[] = array("Title" => "HC-08藍牙4.0BLE串口模塊", "Description" => "HC-08支持和iPhone4s以上的蘋果手機或安卓4.3藍牙4.0的安卓手。。,兩模塊之前也可通訊", "PicUrl" => "https://mmbiz.qlogo.cn/mmbiz/JnIZvkFV6c0gu2PEYJkcP3ngibwfIufAIPcjwpx1W2brgWTfibVe2dhFqKcQEntc6wXVZm8P6LaQ6qic9UOFibyFaA/0?wx_fmt=jpeg", "Url" => "http://www.hchchchc.com/Tpl/product_arc.php?model=HC-08");
$result = $this->transmitNews($object, $content);
break;
// 在線銷售
// 在線銷售
case "OnlineSaler":
$getcustom_mark = redisData::hGet($client_openid, 'custom');
// 重複click
if ($getcustom_mark == "1") {
echo "";
HTTP::end();
} else {
// 得到空閑客服帳號
$kf_account = transToWxServer::findRelaxCustom("HCS");
if (!empty($kf_account)) {
$result = $this->transmitService($object, $kf_account);
redisData::hSet($client_openid, 'custom', "1");
} else {
// 客服不在線
$content = "客服已離線,請稍候重試!";
$result = $this->transmitText($object, $content);
}
}
break;
// 在線技術客服
// 在線技術客服
case "THelp":
$getcustom_mark = redisData::hGet($client_openid, 'custom');
// 重複click
if ($getcustom_mark == "1") {
echo "";
HTTP::end();
} else {
// 得到空閑客服帳號
$kf_account = transToWxServer::findRelaxCustom("HCT");
if (!empty($kf_account)) {
$result = $this->transmitService($object, $kf_account);
redisData::hSet($client_openid, 'custom', "1");
} else {
// 客服不在線
$content = "客服已離線,請稍候重試!";
$result = $this->transmitText($object, $content);
}
}
break;
//匯承官網
//匯承官網
case "IndexHC":
break;
//智能控製
//智能控製
case "IntelligentControl":
// $getintell_mark = redisData::hGet($client_openid,'intell');
// if($getintell_mark == "0")
// {
// redisData::hSet($client_openid,'intell',"1");
// $content = "成功進入智能控製!\n\n";
// $content.="發送數字'0'可退出智能模式";
//.........這裏部分代碼省略.........