PHP: stop requiring google/protobuf PHP implementation

pull/11173/head
Stanley Cheung 8 years ago
parent bcb65f0bd5
commit 6e589c6a15
  1. 7
      composer.json
  2. 3
      examples/php/composer.json
  3. 22
      src/php/README.md
  4. 3
      src/php/tests/qps/composer.json
  5. 7
      templates/composer.json.template

@ -6,12 +6,15 @@
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0",
"google/protobuf": "^v3.3.0"
"php": ">=5.5.0"
},
"require-dev": {
"google/auth": "v0.9"
},
"suggest": {
"ext-protobuf": "For better performance, install the protobuf C extension.",
"google/protobuf": "To get started using grpc quickly, install the native protobuf library."
},
"autoload": {
"psr-4": {
"Grpc\\": "src/php/lib/Grpc/"

@ -2,7 +2,8 @@
"name": "grpc/grpc-demo",
"description": "gRPC example for PHP",
"require": {
"grpc/grpc": "^v1.1.0"
"grpc/grpc": "^v1.3.0",
"google/protobuf": "^v3.3.0"
},
"autoload": {
"psr-4": {

@ -174,6 +174,28 @@ $ sudo make install
```
### Protobuf Runtime library
There are two protobuf runtime libraries to choose from. They are idenfical in terms of APIs offered.
1. C implementation (for better performance)
``` sh
$ sudo pecl install protobuf
```
2. PHP implementation (for easier installation)
Add this to your `composer.json` file:
```
"require": {
"google/protobuf": "^v3.3.0"
}
```
### PHP Protoc Plugin
You need the gRPC PHP protoc plugin to generate the client stub classes.

@ -1,7 +1,8 @@
{
"minimum-stability": "dev",
"require": {
"grpc/grpc": "dev-master"
"grpc/grpc": "dev-master",
"google/protobuf": "^v3.3.0"
},
"autoload": {
"psr-4": {

@ -8,12 +8,15 @@
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0",
"google/protobuf": "^v3.3.0"
"php": ">=5.5.0"
},
"require-dev": {
"google/auth": "v0.9"
},
"suggest": {
"ext-protobuf": "For better performance, install the protobuf C extension.",
"google/protobuf": "To get started using grpc quickly, install the native protobuf library."
},
"autoload": {
"psr-4": {
"Grpc\\": "src/php/lib/Grpc/"

Loading…
Cancel
Save