Make Chrly's domain configurable

This commit is contained in:
ErickSkrauch
2021-03-04 05:58:07 +01:00
parent 163bbe68a2
commit bd168808b2
5 changed files with 13 additions and 5 deletions

View File

@@ -10,10 +10,14 @@ use Yii;
// TODO: convert to complete Chrly client library
class SkinsSystemApi {
private const BASE_DOMAIN = 'http://skinsystem.ely.by';
private string $baseDomain;
private ?ClientInterface $client = null;
public function __construct(string $baseDomain) {
$this->baseDomain = $baseDomain;
}
/**
* @param string $username
* @throws \GuzzleHttp\Exception\GuzzleException
@@ -69,7 +73,7 @@ class SkinsSystemApi {
}
private function buildUrl(string $url): string {
return static::BASE_DOMAIN . $url;
return $this->baseDomain . $url;
}
private function getClient(): ClientInterface {