Skip to content
Snippets Groups Projects
Commit 6aff7aa3 authored by Michael Lumish's avatar Michael Lumish
Browse files

Merge pull request #2649 from stanley-cheung/php_user_agent

Add user-agent for PHP
parents d357cc0a a75098d0
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"name": "grpc/grpc", "name": "grpc/grpc",
"type": "library", "type": "library",
"description": "gRPC library for PHP", "description": "gRPC library for PHP",
"version": "0.5.1",
"keywords": ["rpc"], "keywords": ["rpc"],
"homepage": "http://grpc.io", "homepage": "http://grpc.io",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
......
{ {
"name": "grpc/grpc", "name": "grpc/grpc",
"description": "gRPC library for PHP", "description": "gRPC library for PHP",
"version": "0.5.0", "version": "0.5.1",
"homepage": "http://grpc.io", "homepage": "http://grpc.io",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"repositories": [ "repositories": [
......
...@@ -60,7 +60,10 @@ class BaseStub { ...@@ -60,7 +60,10 @@ class BaseStub {
} }
unset($opts['update_metadata']); 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); $this->channel = new Channel($hostname, $opts);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment