aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php
diff options
context:
space:
mode:
Diffstat (limited to 'src/php')
-rw-r--r--src/php/README.md22
-rw-r--r--src/php/composer.json4
-rw-r--r--src/php/ext/grpc/call.c2
-rw-r--r--src/php/ext/grpc/completion_queue.c5
-rw-r--r--src/php/lib/Grpc/BaseStub.php2
-rw-r--r--src/php/tests/qps/composer.json3
6 files changed, 29 insertions, 9 deletions
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/composer.json b/src/php/composer.json
index bbe33974d5..a4fba7e4f6 100644
--- a/src/php/composer.json
+++ b/src/php/composer.json
@@ -2,10 +2,10 @@
"name": "grpc/grpc-dev",
"description": "gRPC library for PHP - for Developement use only",
"license": "BSD-3-Clause",
- "version": "1.3.3",
+ "version": "1.4.0",
"require": {
"php": ">=5.5.0",
- "google/protobuf": "^v3.1.0"
+ "google/protobuf": "^v3.3.0"
},
"require-dev": {
"google/auth": "v0.9"
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index 86bd40e03d..94e0b73a49 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -65,7 +65,7 @@ static zend_object_handlers call_ce_handlers;
/* Frees and destroys an instance of wrapped_grpc_call */
PHP_GRPC_FREE_WRAPPED_FUNC_START(wrapped_grpc_call)
if (p->owned && p->wrapped != NULL) {
- grpc_call_destroy(p->wrapped);
+ grpc_call_unref(p->wrapped);
}
PHP_GRPC_FREE_WRAPPED_FUNC_END()
diff --git a/src/php/ext/grpc/completion_queue.c b/src/php/ext/grpc/completion_queue.c
index 741204b0b1..c75a524530 100644
--- a/src/php/ext/grpc/completion_queue.c
+++ b/src/php/ext/grpc/completion_queue.c
@@ -38,13 +38,10 @@
grpc_completion_queue *completion_queue;
void grpc_php_init_completion_queue(TSRMLS_D) {
- completion_queue = grpc_completion_queue_create(NULL);
+ completion_queue = grpc_completion_queue_create_for_pluck(NULL);
}
void grpc_php_shutdown_completion_queue(TSRMLS_D) {
grpc_completion_queue_shutdown(completion_queue);
- while (grpc_completion_queue_next(completion_queue,
- gpr_inf_future(GPR_CLOCK_REALTIME),
- NULL).type != GRPC_QUEUE_SHUTDOWN);
grpc_completion_queue_destroy(completion_queue);
}
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index ed504f85a8..24934491b4 100644
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -87,7 +87,7 @@ class BaseStub
'ChannelCredentials::create methods');
}
if ($channel) {
- if (!is_a($channel, 'Channel')) {
+ if (!is_a($channel, 'Grpc\Channel')) {
throw new \Exception('The channel argument is not a'.
'Channel object');
}
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": {