Skip to content

Commit 88dffa7

Browse files
committed
add connect timeout
1 parent 42e5b7b commit 88dffa7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Graphcomment.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function registerUser($username, $email, $language = "en", $picture = '')
104104
"picture" => $picture // (optionnal) full url only
105105
);
106106

107-
$res = $client->request('POST', $this->getDir() . '/pub/sso/registerUser/pubkey/' . urlencode($this->getGcPublic()) . '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
107+
$res = $client->request('POST', $this->getDir() . '/pub/sso/registerUser/pubkey/' . urlencode($this->getGcPublic()) . '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
108108

109109
if ($res->getStatusCode() == "200") {
110110
return $res->getBody();
@@ -128,7 +128,7 @@ public function loginUser($gc_id)
128128
"gc_id" => $gc_id
129129
);
130130

131-
$res = $client->request('POST', $this->getDir() . '/pub/sso/loginUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
131+
$res = $client->request('POST', $this->getDir() . '/pub/sso/loginUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
132132

133133
return $res->getBody();
134134
}
@@ -148,7 +148,7 @@ public function getUser($gc_id)
148148
"gc_id" => $gc_id
149149
);
150150

151-
$res = $client->request('GET', $this->getDir() . '/pub/sso/getUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
151+
$res = $client->request('GET', $this->getDir() . '/pub/sso/getUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
152152

153153
return $res->getBody();
154154
}
@@ -184,7 +184,7 @@ public function updateUser($gc_id, $username, $email, $language, $picture)
184184
"picture" => $picture
185185
);
186186

187-
$res = $client->request('PUT', $this->getDir() . '/pub/sso/updateUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
187+
$res = $client->request('PUT', $this->getDir() . '/pub/sso/updateUser/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
188188

189189
return $res->getBody();
190190
}
@@ -205,7 +205,7 @@ public function deleteUser($gc_id)
205205
"gc_id" => $gc_id
206206
);
207207

208-
$res = $client->request('DELETE', $this->getDir() . '/pub/sso/deleteProfileByGcId/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
208+
$res = $client->request('DELETE', $this->getDir() . '/pub/sso/deleteProfileByGcId/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
209209

210210
return $res->getBody();
211211
}
@@ -227,7 +227,7 @@ public function countComments($url, $uid='') {
227227
"uid" => $uid
228228
);
229229

230-
$res = $client->request('GET', $this->getDir() . '/pub/sso/numberOfComments/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'connect_timeout' => 5]);
230+
$res = $client->request('GET', $this->getDir() . '/pub/sso/numberOfComments/pubkey/' . urlencode($this->getGcPublic()). '/key/' . urlencode($this->generateSsoData($data)), ['http_errors' => false, 'timeout' => 5]);
231231

232232
return $res->getBody();
233233
}

0 commit comments

Comments
 (0)