/** * 推送给所有可以推送的人 * @param array $content 推送内容 */ public function pushToAll($content) { $data = new Data_Push_Func($content); $list = Library_List::getRecent(); $result = $data->pushList($list); Library_List::addLog($content, $result); return $result; }
/** * 微信特有路由 * @return class action实例 */ private function wechatRouter(&$arg) { if (isset($GLOBALS["HTTP_RAW_POST_DATA"]) && !empty($GLOBALS["HTTP_RAW_POST_DATA"])) { //解析XML包 $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; $arg = (array) simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); Vera_Log::addNotice('userID', $arg['FromUserName']); Vera_Log::addNotice('serverID', $arg['ToUserName']); Vera_Log::addNotice('createTime', $arg['CreateTime']); Vera_Log::addNotice('msgType', $arg['MsgType']); if (isset($arg['MsgId'])) { Vera_Log::addNotice('msgId', $arg['MsgId']); } //记录访问日志 Library_List::add($arg['FromUserName']); return ucfirst($arg['MsgType']); } else { if (isset($_GET["echostr"])) { //初次接入微信号 echo $_GET["echostr"]; exit; } else { //异常访问 $url = "/wap"; header("Location: {$url}"); exit; } } }