2017 © Pedro Peláez
 

library ibok

a simple webchat and broadcast live built with PHP-Swoole

image

tianrang/ibok

a simple webchat and broadcast live built with PHP-Swoole

  • Friday, August 4, 2017
  • by tianrang
  • Repository
  • 0 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ibok

php+swoole,简单的聊天室,直播, (*1)

install composer 安装

composer require tianrang/ibok:dev-master, (*2)

usage 使用

  • 自动加载 require './vendor/autoload.php', (*3)

  • 配置参数,并实例化 tianrang\ibok\Start 类,具体配置参考src/config.php, (*4)

  • cli模式运行服务端脚本, (*5)

  • 在浏览器访问客户端脚本, (*6)

example 例子:

  • composer.json 同级目录下,创建文件 do.php

## 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)

The Versions

04/08 2017

dev-master

9999999-dev http://ibok.cc

a simple webchat and broadcast live built with PHP-Swoole

  Sources   Download

MIT

The Requires

  • php >=7.0
  • ext-swoole *
  • ext-redis *

 

by shilei_zhang

php swoole webchat tianrang