Skip to content

Commit 36f38af

Browse files
Pull request #15: Add tracking to SDK as dependecy
Merge in SDK/php_telesign from feature/2112 to developer * commit 'ce6064f333bb6df8d6ec4bfe9ef66171f5e604d1': fix changelog Add tracking to SDK as dependecy
2 parents 31cc29e + ce6064f commit 36f38af

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

RELEASE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
3.0.6
2+
- Add tracking of when SDK is used as a dependency
3+
14
3.0.5
25
- Added tracking to requests
36

src/rest/RestClient.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function __construct (
4141
$api_key,
4242
$rest_endpoint = "https://rest-api.telesign.com",
4343
$source = "php_telesign",
44-
$sdk_version = null,
44+
$sdk_version_origin = null,
45+
$sdk_version_dependency = null,
4546
$timeout = 10,
4647
$proxy = null,
4748
$handler = null
@@ -56,11 +57,15 @@ function __construct (
5657
"handler" => $handler
5758
]);
5859

59-
$current_version = $sdk_version ?? Config::getVersion();
60+
$current_version = $sdk_version_origin ?? Config::getVersion();
6061
$php_version = PHP_VERSION;
6162
$guzzle_version = Client::MAJOR_VERSION;
6263

6364
$this->user_agent = "TeleSignSDK/php PHP/$php_version Guzzle/$guzzle_version OriginatingSDK/$source SDKVersion/$current_version";
65+
66+
if ($source !== 'php_telesign') {
67+
$this->user_agent .= " DependencySDKVersion/$sdk_version_dependency";
68+
}
6469
}
6570

6671
function setRestEndpoint($rest_endpoint) {

0 commit comments

Comments
 (0)