@@ -19,7 +19,7 @@ class Pusher implements LoggerAwareInterface, PusherInterface
19
19
/**
20
20
* @var string Version
21
21
*/
22
- public static $ VERSION = '7.2.3 ' ;
22
+ public static $ VERSION = '7.2.4 ' ;
23
23
24
24
/**
25
25
* @var null|PusherCrypto
@@ -64,12 +64,6 @@ public function __construct(string $auth_key, string $secret, string $app_id, ar
64
64
{
65
65
$ this ->check_compatibility ();
66
66
67
- if (!is_null ($ client )) {
68
- $ this ->client = $ client ;
69
- } else {
70
- $ this ->client = new \GuzzleHttp \Client ();
71
- }
72
-
73
67
$ useTLS = true ;
74
68
if (isset ($ options ['useTLS ' ])) {
75
69
$ useTLS = $ options ['useTLS ' ] === true ;
@@ -119,6 +113,13 @@ public function __construct(string $auth_key, string $secret, string $app_id, ar
119
113
);
120
114
$ this ->crypto = new PusherCrypto ($ parsedKey );
121
115
}
116
+
117
+
118
+ if (!is_null ($ client )) {
119
+ $ this ->client = $ client ;
120
+ } else {
121
+ $ this ->client = new \GuzzleHttp \Client (['timeout ' => $ this ->settings ['timeout ' ],]);
122
+ }
122
123
}
123
124
124
125
/**
@@ -724,7 +725,8 @@ public function get(string $path, array $params = [], $associative = false)
724
725
'query ' => $ signature ,
725
726
'http_errors ' => false ,
726
727
'headers ' => $ headers ,
727
- 'base_uri ' => $ this ->channels_url_prefix ()
728
+ 'base_uri ' => $ this ->channels_url_prefix (),
729
+ 'timeout ' => $ this ->settings ['timeout ' ]
728
730
]);
729
731
730
732
$ status = $ response ->getStatusCode ();
@@ -776,7 +778,8 @@ public function post(string $path, $body, array $params = [])
776
778
'body ' => $ body ,
777
779
'http_errors ' => false ,
778
780
'headers ' => $ headers ,
779
- 'base_uri ' => $ this ->channels_url_prefix ()
781
+ 'base_uri ' => $ this ->channels_url_prefix (),
782
+ 'timeout ' => $ this ->settings ['timeout ' ]
780
783
]);
781
784
} catch (ConnectException $ e ) {
782
785
throw new ApiErrorException ($ e ->getMessage ());
@@ -826,7 +829,8 @@ public function postAsync(string $path, $body, array $params = []): PromiseInter
826
829
'body ' => $ body ,
827
830
'http_errors ' => false ,
828
831
'headers ' => $ headers ,
829
- 'base_uri ' => $ this ->channels_url_prefix ()
832
+ 'base_uri ' => $ this ->channels_url_prefix (),
833
+ 'timeout ' => $ this ->settings ['timeout ' ],
830
834
])->then (function ($ response ) {
831
835
$ status = $ response ->getStatusCode ();
832
836
0 commit comments