Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jafrajarvy292 committed Jan 4, 2020
1 parent 5d88ca3 commit 600ecbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/HTTPHandler/HTTPHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class HTTPHandler
{
/** @var string The SmartAPI Helper version */
private const SMARTAPI_HELPER_VERSION = '1.0.0';
private $smartapi_helper_version = '';
/** @var string User's login name */
private $user_login;
/** @var string User's password */
Expand Down Expand Up @@ -52,6 +52,8 @@ public function __construct()
{
//Initialize cURL resource
$this->ch = curl_init();
//Get the SmartAPI library version
$this->smartapi_helper_version = file_get_contents(__DIR__ . '/../VERSION.config');
}

/**
Expand Down Expand Up @@ -209,7 +211,7 @@ public function curlPrep(): void
//Set user agent
$curl_agent = 'cURL/' . curl_version()['version'];
$php_agent = 'PHP/' . PHP_VERSION;
$smartapi_helper_agent = 'SmartAPIHelper/' . self::SMARTAPI_HELPER_VERSION;
$smartapi_helper_agent = 'SmartAPIHelper/' . $this->smartapi_helper_version;
$full_agent = $smartapi_helper_agent . ' ' . $curl_agent . ' ' . $php_agent;
curl_setopt($this->ch, CURLOPT_USERAGENT, $full_agent);

Expand Down
1 change: 1 addition & 0 deletions src/VERSION.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.2

0 comments on commit 600ecbc

Please sign in to comment.