Download the PHP package buexplain/netsvr-business-serial without Composer

On this page you can find all versions of the php package buexplain/netsvr-business-serial. 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 netsvr-business-serial

netsvr-business-serial

可以快速开发websocket全双工通信业务的包,它必须在串行的php程序中工作,不能在协程中工作,它基于https://github.com/buexplain/netsvr 进行工作。

ps:如果你的项目是hyperf框架的,则可以使用这个包:https://github.com/buexplain/netsvr-business-coroutine

安装步骤

安装netsvr

点击链接:https://github.com/buexplain/netsvr/releases ,进去后下载网关程序,下载后启动网关服务,网关服务会启动:websocket服务器、worker服务器,请仔细阅读netsvr.toml文件。

在你的php项目里面安装本包以及protobuf包

  1. composer require buexplain/netsvr-business-serial
  2. composer require google/protobuf

在框架初始化阶段,初始化本包,步骤如下

Laravel框架

只要在你的laravel项目安装下面这个服务提供者,即可实现服务端主动下发数据到客户端,但是不能实现客户端主动向网关发送数据。

其它的fpm容器下运行的框架初始化方式大同小异,不再赘述。

若要实现双向通信,请参考文章:在laravel下实现全双工的websocket开发

Webman框架

完成以上步骤后

在你的业务代码中使用\NetsvrBusiness\NetBus::class 的静态方法与网关交互,示例:\NetsvrBusiness\NetBus::broadcast("将消息通过广播的方式给到全体在线人员");


All versions of netsvr-business-serial with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
buexplain/netsvr-protocol-php Version ^4.0.0
psr/container Version ^1.0|^2.0
psr/log Version ^2.0|^3.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 buexplain/netsvr-business-serial contains the following files

Loading the files please wait ....