コード例 #1
0
 private function respondText()
 {
     global $_W;
     // start a reponser thread using curl
     $url = $_W['siteroot'] . WechatUtil::createMobileUrl('RunTask', $this->modulename, array('from_user' => $this->message['from']));
     $ret = WechatUtil::http_request($url, null, null, 4000);
     WeUtility::logging("Running task", $url . "==>" . json_encode($ret));
     // responseEmptyMsg and exit
     return $this->responseEmptyMsg();
 }
コード例 #2
0
 private function getQRTicket($token, $data)
 {
     $url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={$token}";
     WeUtility::logging('QR data', json_encode($data));
     $ret = WechatUtil::http_request($url, json_encode($data));
     $content = @json_decode($ret['content'], true);
     WeUtility::logging('QR content', $content);
     return $content;
 }