Download the PHP package sunnnnn/workerman without Composer

On this page you can find all versions of the php package sunnnnn/workerman. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package workerman

将GatewayWorker/Workerman 集成到php框架中(tp5,yii2) linux 版本

配置

config.php中放入配置信息: 'workerman' => [ 'register_address' => '0.0.0.0:1238', //注册ip以及端口 'gateway_socket' => 'Websocket://0.0.0.0:8282', //协议,IP,端口 'gateway_name' => 'gatewayTest', //自定义gateway名称 'gateway_count' => '1', //gateway 进程数 'gateway_lanIp' => '127.0.0.1', //本机ip,分布式部署时使用内网ip 'gateway_startPort' => '4000',// 内部通讯起始端口 'gateway_pingInterval' => '0',// 心跳间隔,0为不发送心跳 'gateway_pingNotResponseLimit' => '0',//几秒内不回应心跳则断开链接,0表示不断开 'gateway_registerAddress' => '127.0.0.1:1238', //服务注册地址 'business_name' => 'businessTest',//自定义business名称 'business_count' => '1',//business 进程数 'business_registerAddress' => '127.0.0.1:1238', //服务注册地址 ],

启动

新增Start.php 继承events\Starts类(或者不继承,用new一个Starts对象) 重写business函数:

use sunnnnn\workerman\Starts; use \GatewayWorker\BusinessWorker;

class Start extends Starts{

public function index(){
    $worker = new BusinessWorker();
    parent::start($worker);
}

}

进入网站根目录,运行 php index.php /yourmodel/start/index

逻辑业务

新增MyEvent.php 继承events\Events类 重新onConnect 、onMessage、onClose 实现业务逻辑:

use sunnnnn\workerman\Events; use \GatewayWorker\Lib\Gateway;

class MyEvent extends Events{

public static function onConnect($client_id){}

public static function onMessage($client_id, $message){}

public static function onClose($client_id){}

}

其余请参考官方手册 http://www.workerman.net/gatewaydoc/


All versions of workerman with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sunnnnn/workerman contains the following files

Loading the files please wait ....