File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 22 "name" : " sparkpost/php-sparkpost" ,
33 "description" : " Client library for interfacing with the SparkPost API." ,
44 "license" : " Apache 2.0" ,
5- "version" : " 1.1.0" ,
65 "authors" : [
76 {
8- "name" : " Message Systems, Inc. "
7+ "name" : " SparkPost "
98 }
109 ],
1110 "minimum-stability" : " stable" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ class SparkPost {
88 public $ transmission ;
99 public $ messageEvents ;
1010
11+ /**
12+ * Library version, used for setting User-Agent.
13+ */
14+ private $ version = '1.1.0 ' ;
15+
1116 /**
1217 * Connection config for making requests.
1318 */
@@ -80,15 +85,11 @@ public function getHttpHeaders() {
8085 * @return Configuration
8186 */
8287 private function getHttpConfig ($ config ) {
83- // get composer.json to extract version number
84- $ composerFile = file_get_contents (dirname (__FILE__ ) . '/../../composer.json ' );
85- $ composer = json_decode ($ composerFile , true );
86-
8788 // create Configuration for http adapter
8889 $ httpConfig = new Configuration ();
8990 $ baseUrl = $ config ['protocol ' ] . ':// ' . $ config ['host ' ] . ($ config ['port ' ] ? ': ' . $ config ['port ' ] : '' ) . '/api/ ' . $ config ['version ' ];
9091 $ httpConfig ->setBaseUri ($ baseUrl );
91- $ httpConfig ->setUserAgent ('php-sparkpost/ ' . $ composer [ ' version ' ] );
92+ $ httpConfig ->setUserAgent ('php-sparkpost/ ' . $ this -> version );
9293 return $ httpConfig ;
9394 }
9495
You can’t perform that action at this time.
0 commit comments