Download the PHP package iboxs/iboxs-worker without Composer
On this page you can find all versions of the php package iboxs/iboxs-worker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download iboxs/iboxs-worker
More information about iboxs/iboxs-worker
Files in iboxs/iboxs-worker
Download iboxs/iboxs-worker
More information about iboxs/iboxs-worker
Files in iboxs/iboxs-worker
Vendor iboxs
Package iboxs-worker
Short Description workerman extend for iboxsphp5
License Apache-2.0
Package iboxs-worker
Short Description workerman extend for iboxsphp5
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package iboxs-worker
iboxsPHP 5.1 Workerman 扩展
安装
composer require iboxs/iboxs-worker
使用方法
SocketServer
首先创建控制器类并继承 iboxs\worker\Server,然后设置属性和添加回调方法
namespace app\index\controller;
use iboxs\worker\Server;
class Worker extends Server
{
protected $socket = 'http://0.0.0.0:2346';
public function onMessage($connection,$data)
{
$connection->send(json_encode($data));
}
}
支持workerman所有的回调方法定义(回调方法必须是public类型)
在应用根目录增加入口文件 server.php
#!/usr/bin/env php
new Http();
在命令行启动服务端
php server.php
All versions of iboxs-worker with dependencies
PHP Build Version
Package Version
The package iboxs/iboxs-worker contains the following files
Loading the files please wait ....