diff options
author | Richard Leland <rich@richleland.com> | 2016-05-03 21:01:01 -0400 |
---|---|---|
committer | Richard Leland <rich@richleland.com> | 2016-05-03 21:01:01 -0400 |
commit | 48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5 (patch) | |
tree | b39775b9c66e0e3b9eaf5868e84524d1ce4803fb /lib/SparkPost | |
parent | cdd84a81dc4e834c309001aa84c7ac7e7350f8d2 (diff) | |
download | php-sparkpost-48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5.zip php-sparkpost-48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5.tar.gz php-sparkpost-48fcc7b0d1eb204a0a49c50f85dde16fbcb5c6b5.tar.bz2 |
Remove reliance on composer
- Some users don't use composer and the code required the composer.json
- Resolves #95
Diffstat (limited to 'lib/SparkPost')
-rw-r--r-- | lib/SparkPost/SparkPost.php | 11 |
1 files changed, 6 insertions, 5 deletions
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; } |