Download the PHP package huangzonglong/pubsub without Composer

On this page you can find all versions of the php package huangzonglong/pubsub. 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 pubsub

PHP实现的grpc客户端

一、安装

composer安装依赖包

安装php的grpc扩展:http://pecl.php.net/package/gRPC

二、demo运行

tests目录中有测试文件test.php可以直接运行,前提是先启动服务端

三、代码指引

文件结构 是通过proto自动自动生成的,主要关注的是src下一级的PHP文件,其中PubSubClient是调用服务的php客户端实现。其他的每个文件对应于proto协议文件定义的服务方法和消息类型的实现类。

1、引入自动加载文件,Pubsub\PubSubClient类继承了grpc类,实现了连接grpc服务端,返回一个客户端连接对象。

2、接下来,在使用$client调用服务前,需要填充所需的参数,参数都是通过不同的对象去设置,根据proto文件,可以知道那个参数属于哪个对象。

调用服务订阅服务,然后调用pull服务监听topic消息(订阅)

3、消息发布,同样,在调用服务前,要填充所需参数

四、Topic

1、topic格式说明

topic是字符串,分成固定的四个层级,每个层级用竖线分隔表示,

如:feeFood|position|update|google,feeFood|position|update|baidu,qqty|chat|say|roomID

,描述为: 项目|服务|方法|可扩展参数

2、订阅时,可以是写全topic,也可以将可变参数改成+号,比如,qqty|chat|say|+,这样就可以订阅到所有房间的聊天

3、发布时,一定要写全topic


All versions of pubsub with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
google/protobuf Version ^3.8
grpc/grpc Version ^1.19
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 huangzonglong/pubsub contains the following files

Loading the files please wait ...