Esempio n. 1
0
 /**
  * @param $pathUrl
  * @param $lang
  * @return null
  * @throws CurlException
  */
 public static function getFromApi($pathUrl, $lang)
 {
     $params = App::getParams('auth');
     $url = $params['url'] . '/' . $pathUrl . "?" . http_build_query(['auth' => ['id' => $params['id'], 'token' => $params['token']], 'lang' => $lang]);
     $url = preg_replace('/(?<!:)\\/(\\/)*/', '/', $url);
     $http = new self();
     return json_decode($http->getCurl($url), 1);
 }