diff options
-rw-r--r-- | composer.json | 3 | ||||
-rw-r--r-- | lib/SparkPost/SparkPost.php | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/composer.json b/composer.json index 470c1b4..be447ce 100644 --- a/composer.json +++ b/composer.json @@ -2,10 +2,9 @@ "name": "sparkpost/php-sparkpost", "description": "Client library for interfacing with the SparkPost API.", "license": "Apache 2.0", - "version": "1.1.0", "authors": [ { - "name": "Message Systems, Inc." + "name": "SparkPost" } ], "minimum-stability": "stable", diff --git a/lib/SparkPost/SparkPost.php b/lib/SparkPost/SparkPost.php index e5f029a..ffc84f0 100644 --- a/lib/SparkPost/SparkPost.php +++ b/lib/SparkPost/SparkPost.php @@ -9,6 +9,11 @@ class SparkPost { public $messageEvents; /** + * Library version, used for setting User-Agent. + */ + private $version = '1.1.0'; + + /** * Connection config for making requests. */ private $config; @@ -80,15 +85,11 @@ class SparkPost { * @return Configuration */ private function getHttpConfig($config) { - // get composer.json to extract version number - $composerFile = file_get_contents(dirname(__FILE__) . '/../../composer.json'); - $composer = json_decode($composerFile, true); - // create Configuration for http adapter $httpConfig = new Configuration(); $baseUrl = $config['protocol'] . '://' . $config['host'] . ($config['port'] ? ':' . $config['port'] : '') . '/api/' . $config['version']; $httpConfig->setBaseUri($baseUrl); - $httpConfig->setUserAgent('php-sparkpost/' . $composer['version']); + $httpConfig->setUserAgent('php-sparkpost/' . $this->version); return $httpConfig; } |