aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Stanley Cheung <stanleycheung@google.com>2015-07-24 09:03:39 -0700
committerGravatar Stanley Cheung <stanleycheung@google.com>2015-07-24 09:04:08 -0700
commita75098d0afb6c8492cc8cdbef014b4de92f8b4c2 (patch)
treec58121b8ae371cb4092f59b92c7edb535d46714d
parentd357cc0a6392989e7d6c08c022f95f71e89b1059 (diff)
add user-agent for php
-rw-r--r--composer.json1
-rw-r--r--src/php/composer.json2
-rwxr-xr-xsrc/php/lib/Grpc/BaseStub.php5
3 files changed, 6 insertions, 2 deletions
diff --git a/composer.json b/composer.json
index 875ec55d8a..1d78a2ce21 100644
--- a/composer.json
+++ b/composer.json
@@ -2,6 +2,7 @@
"name": "grpc/grpc",
"type": "library",
"description": "gRPC library for PHP",
+ "version": "0.5.1",
"keywords": ["rpc"],
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
diff --git a/src/php/composer.json b/src/php/composer.json
index b0115bdadd..2d0fe0c87a 100644
--- a/src/php/composer.json
+++ b/src/php/composer.json
@@ -1,7 +1,7 @@
{
"name": "grpc/grpc",
"description": "gRPC library for PHP",
- "version": "0.5.0",
+ "version": "0.5.1",
"homepage": "http://grpc.io",
"license": "BSD-3-Clause",
"repositories": [
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php
index 48c00977eb..8c438e4bf9 100755
--- a/src/php/lib/Grpc/BaseStub.php
+++ b/src/php/lib/Grpc/BaseStub.php
@@ -60,7 +60,10 @@ class BaseStub {
}
unset($opts['update_metadata']);
}
-
+ $package_config = json_decode(
+ file_get_contents(dirname(__FILE__) . '/../../composer.json'), true);
+ $opts['grpc.primary_user_agent'] =
+ 'grpc-php/' . $package_config['version'];
$this->channel = new Channel($hostname, $opts);
}