Watch 1 Star 8 Fork 13

天然呆 / chat_php

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
聊天后台 spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

聊天软件后台

安装

将以下代码添加到 composer.json中的require,重要的是后三句。如末安装compser 请联系作者将完整安装包发给你。

"require": {
    "php": ">=5.6.0",
    "workerman/gateway-worker": "^3.0",
    "workerman/mysql": "^1.0",
    "workerman/gatewayclient": "^3.0"
}

composer install

以下以linux为例,执行前请先检测workermanPHP扩展及Redis和PHP Redis扩展 windows用户请参见手册的 Windows系统快速开始

php start.php start

start.php 文件和ws文件可以放到任何目录,只要改一下引用即可。当然你也可以修改ws文件夹名称,只需要start.php修改好路径。

如果是小程序、APP等需要用到wss 433端口,建议使用利用nginx/apache代理wss

支持多端口同时运行,复制/ws/chat/文件,修改好start_businessworker.php中的各项参数,到start.php中增加引用

工作逻辑

当用户发来消息后,将消息转成数组 ,数组中须有 $data['module']) $data['action'],将直接调用相应的类和方法。

Comments ( 0 )

Sign in for post a comment

1
https://gitee.com/wuxq1985/chat_php.git
git@gitee.com:wuxq1985/chat_php.git
wuxq1985
chat_php
chat_php
master

Search

231008 48f1a665 1899542 231017 9a6720c6 1899542