Advertisement
alex1rap

BegetCron.php

Nov 11th, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Created by PhpStorm.
  5.  * User: alex1rap
  6.  * Date: 11.11.2016
  7.  * Time: 23:29
  8.  */
  9. class BegetCron
  10. {
  11.     private $beget_url = "https://api.beget.ru/api/cron/";
  12.     private $login;
  13.     private $password;
  14.  
  15.     public function BegetCron($login, $password)
  16.     {
  17.         $this->login = $login;
  18.         $this->password = $password;
  19.     }
  20.  
  21.     public function use ($method, $parameters = [])
  22.     {
  23.         $parameters = http_build_query($parameters);
  24.         $url = $this->beget_url . $method . "?login=" . $this->login . "&password=" . $this->password . "&output_format=json&$parameters";
  25.         return json_decode(file_get_contents($url));
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement