php中Redis的应用--消息传递

时间:2017-04-08

执行代码并添加新成员

 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页:
  • 上一页
  • 4/5
  • 下一页
  • 上一篇:Ubuntu 16.04下安装PHP 7过程详解 下一篇:php传值方式和ajax的验证功能

    相关文章

    最新文章