mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 08:00:25 +05:30
68ce8b3fb6
Исправлена ошибка в JoinForm Добавлено базовое API для общения с сервером системы скинов
30 lines
644 B
PHP
30 lines
644 B
PHP
<?php
|
|
namespace common\components\SkinSystem;
|
|
|
|
use GuzzleHttp\Client as GuzzleClient;
|
|
use Yii;
|
|
|
|
class Api {
|
|
|
|
const BASE_DOMAIN = 'http://skinsystem.ely.by';
|
|
|
|
public function textures($username) : array {
|
|
$response = $this->getClient()->get($this->getBuildUrl('/textures/' . $username));
|
|
$textures = json_decode($response->getBody(), true);
|
|
|
|
return $textures;
|
|
}
|
|
|
|
protected function getBuildUrl(string $url) : string {
|
|
return self::BASE_DOMAIN . $url;
|
|
}
|
|
|
|
/**
|
|
* @return GuzzleClient
|
|
*/
|
|
protected function getClient() : GuzzleClient {
|
|
return Yii::$app->guzzle;
|
|
}
|
|
|
|
}
|