File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " sparkpost/php-sparkpost" ,
3
3
"description" : " Client library for interfacing with the SparkPost API." ,
4
4
"license" : " Apache 2.0" ,
5
- "version" : " 1.1.0" ,
6
5
"authors" : [
7
6
{
8
- "name" : " Message Systems, Inc. "
7
+ "name" : " SparkPost "
9
8
}
10
9
],
11
10
"minimum-stability" : " stable" ,
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ class SparkPost {
8
8
public $ transmission ;
9
9
public $ messageEvents ;
10
10
11
+ /**
12
+ * Library version, used for setting User-Agent.
13
+ */
14
+ private $ version = '1.1.0 ' ;
15
+
11
16
/**
12
17
* Connection config for making requests.
13
18
*/
@@ -80,15 +85,11 @@ public function getHttpHeaders() {
80
85
* @return Configuration
81
86
*/
82
87
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
-
87
88
// create Configuration for http adapter
88
89
$ httpConfig = new Configuration ();
89
90
$ baseUrl = $ config ['protocol ' ] . ':// ' . $ config ['host ' ] . ($ config ['port ' ] ? ': ' . $ config ['port ' ] : '' ) . '/api/ ' . $ config ['version ' ];
90
91
$ httpConfig ->setBaseUri ($ baseUrl );
91
- $ httpConfig ->setUserAgent ('php-sparkpost/ ' . $ composer [ ' version ' ] );
92
+ $ httpConfig ->setUserAgent ('php-sparkpost/ ' . $ this -> version );
92
93
return $ httpConfig ;
93
94
}
94
95
You can’t perform that action at this time.
0 commit comments