Commit e7e261f1 authored by Alex Ne's avatar Alex Ne

get vk token while limit

parent eb56fe1a
...@@ -29,9 +29,11 @@ class ServerToken extends VKAPI { ...@@ -29,9 +29,11 @@ class ServerToken extends VKAPI {
$params["grant_type"] = "client_credentials"; $params["grant_type"] = "client_credentials";
$params["v"] = $this->Credentials->get_api_version(); $params["v"] = $this->Credentials->get_api_version();
$data = false; $data = false;
while ( ! $data) { $co = 0;
while ( ! $data && $co < 10) {
$data = $this->query($this->oauth_url . "access_token", $params); $data = $this->query($this->oauth_url . "access_token", $params);
if ( ! $data) {sleep(1);} if ( ! $data) {sleep(1);}
$co++;
} }
if (isset($data["access_token"])) { if (isset($data["access_token"])) {
$this->server_token = $data["access_token"]; $this->server_token = $data["access_token"];
......
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