Commit eb56fe1a authored by Alex Ne's avatar Alex Ne

while get token

parent acf8163b
......@@ -28,8 +28,11 @@ class ServerToken extends VKAPI {
$params["client_secret"] = $this->Credentials->get_client_secret();
$params["grant_type"] = "client_credentials";
$params["v"] = $this->Credentials->get_api_version();
$data = $this->query($this->oauth_url . "access_token", $params);
$data = false;
while ( ! $data) {
$data = $this->query($this->oauth_url . "access_token", $params);
if ( ! $data) {sleep(1);}
}
if (isset($data["access_token"])) {
$this->server_token = $data["access_token"];
} else {
......
......@@ -54,10 +54,10 @@ class VKAPI {
$ClientResponse = $Client->exec();
if ($data = $ClientResponse->json_decode()) {
return $data;
} else {
return $ClientResponse->get_body();
}
return;
} #else {
#return $ClientResponse->get_body();
#}
return false;
}
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment