? Php ***** wechatbasiccallback *** require_oncedirname (_ FILE __)... commonGlobalDefine. php; classWeChatCallback {protected $ _ postObject; protected $ _ fromUserName; protected $ _ toUserName; protected $ _ createTime; protected $ _ m
? Php/***** wechat basic callback ***/require_once dirname (_ FILE __). '/.. /common/GlobalDefine. php'; class WeChatCallback {protected $ _ postObject; protected $ _ fromUserName; protected $ _ toUserName; protected $ _ createTime; protected $ _ m
/**
*
* Wechat basic callback
*
**/
Require_once dirname (_ FILE _). '/../common/GlobalDefine. php ';
Class WeChatCallback {
Protected $ _ postObject;
Protected $ _ fromUserName;
Protected $ _ toUserName;
Protected $ _ createTime;
Protected $ _ msgType;
Protected $ _ msgId;
Protected $ _ time;
Pubilc function getToUserName (){
Return $ this-> _ toUserName;
}
// Assemble the prompt message. HINT_TPL is defined in GlobalDefine. php.
Protected function init ($ postObj ){
$ ResultStr = sprintf (HINT_TPL, $ this-> _ fromUserName,
$ This-> _ toUserName, & this-> _ time, 'text', $ hint );
Return $ resultStr;
}
Pubilc function init ($ postObj ){
// Obtain parameters
$ This-> _ postObject = $ postObj;
If ($ this-> _ postObject = false ){
Return false;
}
$ This-> _ fromUserName = (string) trim ($ this-> _ postObject-> FromUserName );
$ This-> _ createTime = (int) trim ($ this-> _ postObject-> MsgId );
$ This-> _ time = time ();
If (! ($ This-> _ fromUserName & $ this-> _ toUserName & $ this-> _ msgType )){
Return false;
}
Return true;
}
Public function process (){
// HINT_NOT_IMPLEMEMT indicates a prompt defined in GlobalDefine. php.
Return $ this-> makeHint (HINT_NOT_IMPLEMEMT );
}
}
?>