dev-master
9999999-dev http://ibok.cca simple webchat and broadcast live built with PHP-Swoole
MIT
The Requires
- php >=7.0
- ext-swoole *
- ext-redis *
by shilei_zhang
php swoole webchat tianrang
Wallogit.com
2017 © Pedro Peláez
a simple webchat and broadcast live built with PHP-Swoole
php+swoole,简单的聊天室,直播, (*1)
composer require tianrang/ibok:dev-master, (*2)
自动加载 require './vendor/autoload.php', (*3)
配置参数,并实例化 tianrang\ibok\Start 类,具体配置参考src/config.php, (*4)
cli模式运行服务端脚本, (*5)
在浏览器访问客户端脚本, (*6)
## composer 自动加载 require './vendor/autoload.php'; ## 项目初始化配置 $config = [ 'host' => '192.168.10.20' ]; ## 初始化项目实例 $bootstrap = tianrang\ibok\Start::init($config); ## 判断脚本运行模式 $type = $_GET['type'] ?? 'server'; ## cli模式运行服务端脚本 if ($type === 'server') { preg_match("/cli/i", php_sapi_name()) === 0 && die('必须用CLI模式运行!'); $bootstrap->serverRun(); } ## fcgi模式运行客户端脚本 if ($type === 'client') { $bootstrap->clientRun(); }
linux 上运行 do.php
, (*7)
浏览器访问 http://XXX.com/do.php?type=client
, (*8)
a simple webchat and broadcast live built with PHP-Swoole
MIT
php swoole webchat tianrang