| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- header("Content-Type:text/html; charset=utf-8");
- $json = $GLOBALS['HTTP_RAW_POST_DATA'];
- $post = json_decode($json,true);
- define("CTL",'ctl');
- define("ACT",'act');
- if(!defined('APP_ROOT_PATH'))
- define('APP_ROOT_PATH', str_replace('imcallback.php', '', str_replace('\\', '/', __FILE__)));
- require APP_ROOT_PATH.'public/directory_init.php';
- require APP_ROOT_PATH.'system/define.php';
- require APP_ROOT_PATH."system/cache/Rediscache/Rediscache.php";
- if ($post['CallbackCommand'] == 'Group.CallbackAfterNewMemberJoin'){
- define("FANWE_REQUIRE",true);
- //require './system/system_init.php';
- require(APP_ROOT_PATH.'mapi/lib/redis/BaseRedisService.php');
- require(APP_ROOT_PATH.'mapi/lib/redis/VideoViewerRedisService.php');
- $video_viewer_obj = new VideoViewerRedisService();
- $video_viewer_obj->member_join($post);
- }else if ($post['CallbackCommand'] == 'Group.CallbackAfterMemberExit'){
- define("FANWE_REQUIRE",true);
- //require './system/system_init.php';
- require(APP_ROOT_PATH.'mapi/lib/redis/BaseRedisService.php');
- require(APP_ROOT_PATH.'mapi/lib/redis/VideoViewerRedisService.php');
- $video_viewer_obj = new VideoViewerRedisService();
- $video_viewer_obj->member_exit($post);
- }
- $data = array();
- $data['ActionStatus'] = 'OK';
- $data['ErrorCode'] = 0;
- $data['ErrorInfo'] = '';
- echo json_encode($data);
- exit;
- // 打印log
- function log_result2($word)
- {
- $file="./imcallback_log/notify_url.log";//log文件路径
- $fp = fopen($file,"a");
- flock($fp, LOCK_EX) ;
- fwrite($fp,"执行日期:".strftime("%Y-%m-%d-%H:%M:%S",time())."\n".$word."\n\n");
- flock($fp, LOCK_UN);
- fclose($fp);
- }
- ?>
|