2017 © Pedro Peláez
 

think-extend think-worker

workerman extend for thinkphp5.1

image

topthink/think-worker

workerman extend for thinkphp5.1

  • Wednesday, August 1, 2018
  • by topthink
  • Repository
  • 5 Watchers
  • 87 Stars
  • 16,062 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 24 Forks
  • 5 Open issues
  • 20 Versions
  • 22 % Grown

The README.md

ThinkPHP 5.0 Workerman 扩展

安装

composer require topthink/think-worker, (*1)

使用方法

首先创建控制器类并继承 think\worker\Server,然后设置属性和添加回调方法, (*2)

namespace app\index\controller;

use think\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类型), (*3)

在应用根目录增加入口文件 server.php, (*4)

#!/usr/bin/env php
<?php
define('APP_PATH', __DIR__ . '/application/');

define('BIND_MODULE','index/Worker');

// 加载框架引导文件
require __DIR__ . '/thinkphp/start.php';

在命令行启动服务端, (*5)

php server.php start

linux下面可以支持下面指令, (*6)

php server.php start|stop|status|restart|reload

在浏览器中进行客户端测试 http://127.0.0.1:2346/?id=1, (*7)

The Versions

01/08 2018

2.0.x-dev

2.0.9999999.9999999-dev

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

30/07 2018

v2.0.9

2.0.9.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

29/07 2018

v2.0.8

2.0.8.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

29/07 2018

dev-analysis-8PaD3K

dev-analysis-8PaD3K

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

28/07 2018

dev-analysis-z9KP2l

dev-analysis-z9KP2l

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

28/07 2018

dev-analysis-Xa15BB

dev-analysis-Xa15BB

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

28/07 2018

dev-analysis-q26YBR

dev-analysis-q26YBR

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

28/07 2018

dev-analysis-q11lJv

dev-analysis-q11lJv

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

26/07 2018

v2.0.7

2.0.7.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

18/07 2018

v2.0.6

2.0.6.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

09/07 2018

v2.0.5

2.0.5.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

02/07 2018

v2.0.4

2.0.4.0

workerman extend for thinkphp5.1

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

28/06 2018

v2.0.3

2.0.3.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

27/06 2018

v2.0.2

2.0.2.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

27/06 2018

dev-analysis-zGkJWo

dev-analysis-zGkJWo

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

25/06 2018

v2.0.1

2.0.1.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

25/06 2018

v2.0.0

2.0.0.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

08/10 2016

dev-master

9999999-dev

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

08/10 2016

v1.0.1

1.0.1.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st

04/10 2016

v1.0.0

1.0.0.0

workerman extend for thinkphp5

  Sources   Download

Apache-2.0

The Requires

 

by liu21st