Добавлена логика HasJoined для сервера авторизации Minecraft

Исправлена ошибка в JoinForm
Добавлено базовое API для общения с сервером системы скинов
This commit is contained in:
ErickSkrauch
2016-09-06 12:56:39 +03:00
parent 198e440b8d
commit 68ce8b3fb6
17 changed files with 444 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
<?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;
}
}