php中Redis的应用(4)

include './ManyPullMessage.class.php'; $object=new ManyPullMessage('192.168.95.11'); $b=$object->addMembers('jack','568',array('jane1','jane2','jane3','jane4')); echo "<pre>"; print_r($b); echo "</pre>";die;

3、建立delete.php(测试群主删除成员功能)

include './ManyPullMessage.class.php'; $object=new ManyPullMessage('192.168.95.11'); #群主删除成员 $c=$object->delMembers('jack', '568', array('jane1','jane4')); echo "<pre>"; print_r($c); echo "</pre>";die;

4、建立sendMessage.php(测试发送消息功能)

多执行几遍,568、569都发几条

include './ManyPullMessage.class.php'; $object=new ManyPullMessage('192.168.95.11'); #发送消息 $user='jane2'; $message='go go go'; $groupChatID=568; $arr=array('sender'=>$user, 'message'=>$message, 'time'=>time()); $d=$object->sendMessage($user,$groupChatID,$arr); echo "<pre>"; print_r($d); echo "</pre>";die;

5、建立getNewMessage.php(测试用户获取新消息功能)

include './ManyPullMessage.class.php'; $object=new ManyPullMessage('192.168.95.11'); #用户获取新消息 $e=$object->getNewMessage('jane2'); echo "<pre>"; print_r($e); echo "</pre>";die;

6、建立getPartMessage.php(测试用户获取某个群组部分消息)

(多发送几条消息,用于测试。568中共18条数据)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/acf61a7f63e652863fa9e1b1065029fa.html