commit | a75098d0afb6c8492cc8cdbef014b4de92f8b4c2 | [log] [tgz] |
---|---|---|
author | Stanley Cheung <stanleycheung@google.com> | Fri Jul 24 09:03:39 2015 -0700 |
committer | Stanley Cheung <stanleycheung@google.com> | Fri Jul 24 09:04:08 2015 -0700 |
tree | c58121b8ae371cb4092f59b92c7edb535d46714d | |
parent | d357cc0a6392989e7d6c08c022f95f71e89b1059 [diff] [blame] |
add user-agent for php
diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 48c0097..8c438e4 100755 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php
@@ -60,7 +60,10 @@ } 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); }