diff options
author | Stanley Cheung <stanleycheung@google.com> | 2017-05-16 18:09:36 -0700 |
---|---|---|
committer | Stanley Cheung <stanleycheung@google.com> | 2017-05-16 18:09:36 -0700 |
commit | 6e589c6a15da708a2081b1955170393321327878 (patch) | |
tree | 1d9a8220439d3b24d7113146f363e5eb28ef376f | |
parent | bcb65f0bd533ff0c7babf3b06a424d2bd5f1d37d (diff) |
PHP: stop requiring google/protobuf PHP implementation
-rw-r--r-- | composer.json | 7 | ||||
-rw-r--r-- | examples/php/composer.json | 3 | ||||
-rw-r--r-- | src/php/README.md | 22 | ||||
-rw-r--r-- | src/php/tests/qps/composer.json | 3 | ||||
-rw-r--r-- | templates/composer.json.template | 7 |
5 files changed, 36 insertions, 6 deletions
diff --git a/composer.json b/composer.json index 284b57a809..2cf3f17221 100644 --- a/composer.json +++ b/composer.json @@ -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/" diff --git a/examples/php/composer.json b/examples/php/composer.json index f4b177c271..9d900ebec1 100644 --- a/examples/php/composer.json +++ b/examples/php/composer.json @@ -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": { diff --git a/src/php/README.md b/src/php/README.md index f9f93ba815..90c8cb386a 100644 --- a/src/php/README.md +++ b/src/php/README.md @@ -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. diff --git a/src/php/tests/qps/composer.json b/src/php/tests/qps/composer.json index 0fc87098f5..8c1e7b6c74 100644 --- a/src/php/tests/qps/composer.json +++ b/src/php/tests/qps/composer.json @@ -1,7 +1,8 @@ { "minimum-stability": "dev", "require": { - "grpc/grpc": "dev-master" + "grpc/grpc": "dev-master", + "google/protobuf": "^v3.3.0" }, "autoload": { "psr-4": { diff --git a/templates/composer.json.template b/templates/composer.json.template index 2d4cb11919..a18624db46 100644 --- a/templates/composer.json.template +++ b/templates/composer.json.template @@ -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/" |