output = ''; # 获取微信消息 $this->request(); # 对消息进行验证,并根据类型得到本平台的配置数据 //$this->response(); # 输出 $this->output(); } /** * 输出 * * @return mixed */ private function output() { if (!$this->output) { $this->output = 'success'; } echo $this->output;die; } /** * 获取微信发送的内容 * * @return mixed */ private function request() { //$post = $_GET ? $_GET : $_POST; $post = file_get_contents('php://input'); Dever::log(time()); if (!empty($post)) { $post = json_encode($post); Dever::log($post); return; libxml_disable_entity_loader(true); $result = (array) simplexml_load_string($post, 'SimpleXMLElement', LIBXML_NOCDATA); $this->handle($result); } else { return false; } } }