Огромный рефакторинг в пользу отказа от механизма environment и использования .env файла

Найдено и удалено немного мусора
This commit is contained in:
ErickSkrauch
2016-09-16 01:28:28 +03:00
parent e76a8324fb
commit 54485b2271
56 changed files with 209 additions and 763 deletions

View File

@@ -25,6 +25,7 @@ class SessionController extends ApiController {
$behaviors['rateLimiting'] = [
'class' => RateLimiter::class,
'only' => ['has-joined', 'has-joined-legacy'],
'authserverDomain' => getenv('AUTHSERVER_HOST'),
];
return $behaviors;

View File

@@ -18,10 +18,6 @@ class RateLimiter extends \yii\filters\RateLimiter {
public function init() {
parent::init();
if ($this->authserverDomain === null) {
$this->authserverDomain = Yii::$app->params['authserverDomain'] ?? null;
}
if ($this->authserverDomain === null) {
throw new InvalidConfigException('authserverDomain param is required');
}
@@ -45,6 +41,7 @@ class RateLimiter extends \yii\filters\RateLimiter {
* @inheritdoc
*/
public function checkRateLimit($user, $request, $response, $action) {
// TODO: теперь в authserverDomain хранится hostname без schema, а getHostInfo() возвращает с http(s).
if ($request->getHostInfo() === $this->authserverDomain) {
return;
}