Skip to content

Commit

Permalink
PHP: stop requiring google/protobuf PHP implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed May 17, 2017
1 parent bcb65f0 commit 6e589c6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
3 changes: 2 additions & 1 deletion examples/php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
22 changes: 22 additions & 0 deletions src/php/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/php/tests/qps/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"minimum-stability": "dev",
"require": {
"grpc/grpc": "dev-master"
"grpc/grpc": "dev-master",
"google/protobuf": "^v3.3.0"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 5 additions & 2 deletions templates/composer.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit 6e589c6

Please sign in to comment.