本文整理汇总了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'可退出智能模式";
//.........这里部分代码省略.........