Merge branch 'master' into oauth_jwt_tokens

# Conflicts:
#	api/components/OAuth2/Entities/AccessTokenEntity.php
#	api/components/OAuth2/Entities/RefreshTokenEntity.php
#	api/components/OAuth2/Grants/RefreshTokenGrant.php
#	api/components/OAuth2/Storage/SessionStorage.php
#	api/components/User/OAuth2Identity.php
This commit is contained in:
ErickSkrauch
2019-12-04 01:17:12 +03:00
8 changed files with 99 additions and 24 deletions

View File

@@ -65,12 +65,22 @@ class Textures {
public function getTextures(): array {
/** @var SkinSystemApi $api */
$api = Yii::$container->get(SkinSystemApi::class);
if (YII_ENV_PROD) {
$api->setClient(new \GuzzleHttp\Client([
'connect_timeout' => 2,
'decode_content' => false,
'read_timeout' => 5,
'stream' => true,
'timeout' => 5,
]));
}
try {
$textures = $api->textures($this->account->username);
} catch (RequestException $e) {
Yii::warning('Cannot get textures from skinsystem.ely.by. Exception message is ' . $e->getMessage());
} catch (GuzzleException $e) {
Yii::error($e);
Yii::warning($e);
}
return $textures ?? [];