Overview

Packages

  • None
  • WxRobot
    • Admin
    • Cmd
    • CoreFunctions
    • Exends
    • Install
    • Table
    • Uninstall
    • WxSDK

Classes

  • ErrorCode
  • PKCS7Encoder
  • Prpcrypt
  • SHA1
  • Weixin_BaseCore
  • WeiXin_SDK
  • Weixin_Template
  • WXBizMsgCrypt
  • WxRobot_Admin
  • WxRobot_Admin_Menu_Extends
  • WxRobot_Admin_Menu_Instro
  • WxRobot_Admin_Menu_Menu
  • WxRobot_Admin_Menu_Records
  • WxRobot_Admin_Menu_Reply
  • WxRobot_Admin_Menu_Setting
  • WxRobot_Admin_Menu_Statistics
  • WxRobot_Cmd
  • WxRobot_Cmd_Event
  • WxRobot_Cmd_Event_User
  • WxRobot_Cmd_Text
  • WxRobot_Extends
  • WxRobot_Install
  • WxRobot_Robot
  • WxRobot_SDK
  • WxRobot_Table_Extends
  • WxRobot_Table_Menu
  • WxRobot_Table_Records
  • WxRobot_Table_Reply
  • WxRobot_Uninstall
  • WxRobot_Wp
  • XMLParse

Functions

  • wx_admin_log
  • wx_is_xml
  • wx_notice_msg
  • wx_parse_xml
  • wx_random_big_pic
  • wx_random_small_pic
  • wx_request_array
  • wx_request_decode
  • wx_request_is_encode
  • wx_request_xml
  • wx_send_encode
  • Overview
  • Package
  • Class
  1: <?php
  2: /**
  3:  *  WxRobot - 事件处理类
  4:  *
  5:  *  @author     midoks
  6:  *  @category   WxRobot
  7:  *  @package    WxRobot/Cmd
  8:  *  @since      5.3.0
  9:  */
 10: 
 11: /**
 12:  *  WxRobot_Cmd_Event 事件命令处理类
 13:  */
 14: class WxRobot_Cmd_Event{
 15: 
 16:     /**
 17:      * WxRobot_Cmd_Text Instance
 18:      */
 19:     public static $_instance = null;
 20: 
 21:     /**
 22:      * WxRobot 文本消息处理类实例化
 23:      * 
 24:      * @return WxRobot_Cmd_Text instance
 25:      */
 26:     public static function instance(){
 27:         if( is_null (self::$_instance)){
 28:             self::$_instance = new self();
 29:         }
 30:         return self::$_instance;
 31:     }
 32: 
 33:     /**
 34:      * 构造函数
 35:      */
 36:     public function __construct(){
 37:         $this->options = get_option(WEIXIN_ROBOT_OPTIONS);
 38:         $this->wxSdk   = WxRobot_SDK::instance();
 39:         $this->extends = WxRobot_Extends::instance();
 40:         $this->info    = wx_request_array();
 41:     }
 42: 
 43:     /**
 44:      * 订阅事件
 45:      *
 46:      * @return xml|bool
 47:      */
 48:     public function subscribeEvent(){
 49:         if($wp_plugins = $this->extends->dealwith('subscribe', $this->info)){
 50:             return $wp_plugins;
 51:         }
 52: 
 53:         $s = $this->options['subscribe'];
 54:         if(!empty($s)){
 55:             return $this->wxSdk->toMsgText($s);
 56:         }
 57: 
 58:         return false;
 59:     }
 60: 
 61:     /**
 62:      * 取消订阅时间
 63:      * 
 64:      * @return mixed
 65:      */
 66:     public function unsubscribeEvent(){
 67:         return $this->wxSdk->toMsgText('谢谢你的使用!!!');
 68:     }
 69: 
 70:     /**
 71:      * 上报地址事件(服务号开启后,会每隔5分钟回复一次)
 72:      * 
 73:      * @return mixed
 74:      */
 75:     public function LOCATIONEvent(){
 76:         //基本数据
 77:         $info['Latitude'] = $this->info['Latitude'];
 78:         $info['Longitude'] = $this->info['Longitude'];
 79:         $info['Precision'] = $this->info['Precision'];
 80: 
 81:         if($wp_plugins = $this->extends->dealwith('location', $info)){
 82:             return $wp_plugins;
 83:         }
 84:     }
 85: 
 86:     /**
 87:      * 用户已关注时的事件推送
 88:      *
 89:      * @return xml
 90:      */
 91:     public function scanEvent(){
 92:         if($wp_plugins = $this->extends->dealwith('scan', $this->$info)){
 93:             return $wp_plugins;
 94:         }
 95:     }
 96: 
 97:     /**
 98:      * 模版消息返回信息(暂时不处理)
 99:      *
100:      * @return void
101:      */
102:     public function TEMPLATESENDJOBFINISHEvent(){}
103: 
104:     /**
105:      * 事件推送群发结果(暂时不处理)
106:      *
107:      * @return void
108:      */
109:     public function MASSSENDJOBFINISHEvent(){}
110: }
111: ?>
112: 
API documentation generated by ApiGen