Skip to content

Commit

Permalink
add user-agent for php
Browse files Browse the repository at this point in the history
  • Loading branch information
stanley-cheung committed Jul 24, 2015
1 parent d357cc0 commit a75098d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/php/composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
5 changes: 4 additions & 1 deletion src/php/lib/Grpc/BaseStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ public function __construct($hostname, $opts) {
}
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);
}

Expand Down

0 comments on commit a75098d

Please sign in to comment.