diff options
author | 2015-07-27 16:16:29 -0700 | |
---|---|---|
committer | 2015-07-27 16:16:29 -0700 | |
commit | 4aee7240041cec7ff4a3d29c6348d2b62a6bd0bf (patch) | |
tree | 28cff9ca87ad2af0c27c4d01c832b9da332c7a3a /src/php/lib | |
parent | 5029b30d1ce8509a4b2f7c17e88bddb8a5206f56 (diff) | |
parent | 2aff2b449f22e0eb7995d31a6c137e6a5951d6c6 (diff) |
Merge branch 'master' of github.com:grpc/grpc into ssl_force_client_auth
Diffstat (limited to 'src/php/lib')
-rw-r--r-- | src/php/lib/Grpc/AbstractCall.php | 7 | ||||
-rwxr-xr-x | src/php/lib/Grpc/BaseStub.php | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/php/lib/Grpc/AbstractCall.php b/src/php/lib/Grpc/AbstractCall.php index 5b28417a0d..35057224f8 100644 --- a/src/php/lib/Grpc/AbstractCall.php +++ b/src/php/lib/Grpc/AbstractCall.php @@ -68,6 +68,13 @@ abstract class AbstractCall { } /** + * @return string The URI of the endpoint. + */ + public function getPeer() { + return $this->call->getPeer(); + } + + /** * Cancels the call */ public function cancel() { diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index 48c00977eb..a0c677908c 100755 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -60,11 +60,21 @@ 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); } /** + * @return string The URI of the endpoint. + */ + public function getTarget() { + return $this->channel->getTarget(); + } + + /** * Close the communication channel associated with this stub */ public function close() { |