Download the PHP package language/yii2-protobuf without Composer

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

Yii Protobuf Extension is a wrapper for php protobuf c-extension.It provides an easy way to decode/encoder protobuf data with Yii.In addition to,it provides a tool to generate php proto files from .proto.

You must install php c-ext before you can use this extension

Requirements

To use PHP runtime library requires:

Installation

You can install this extension by composer, as follows:

Configure

You need to add protobuf parser/formatter for request/response Component, as follows:

As you can see, this extension use Content-Type to distinguish protobuf binary data.So, Client should set Content-Type as when it send protobuf binary data to Server

Generate Proto

You can run build.sh shell script to generate proto files after Editing msg.proto. it will generate and .You should always edit .proto instead of editing generated proto files

Register Proto

You need to register .proto.php files for encode protobuf data after generate proto files.You can create a base controller and register them, As follows:

ProtobufTrait provides method to convert php hash table to protobuf data

Usage

You should alway get request params with intead of .ProtobufParser parser protobuf to array

Sample

Customized Request Struct

By default, protobuf parser can only parser map<string,string> protobuf data as message-defined

You can define your request proto, as follows

Then, you should tell ProtobufFormatter which class to serialize Array Data

If you need more flexiable data-struct, you can parser the protobuf raw data, as follows:

FlexiableRequest is a internal proto define. So, don't change the message name.


All versions of yii2-protobuf with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
ext-protobuf Version >=3.5.0
yiisoft/yii2 Version ~2.0.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 language/yii2-protobuf contains the following files

Loading the files please wait ....