2016-01-02 16:43:18 +03:00
|
|
|
<?php
|
|
|
|
$params = array_merge(
|
|
|
|
require(__DIR__ . '/../../common/config/params.php'),
|
|
|
|
require(__DIR__ . '/../../common/config/params-local.php'),
|
|
|
|
require(__DIR__ . '/params.php'),
|
|
|
|
require(__DIR__ . '/params-local.php')
|
|
|
|
);
|
|
|
|
|
|
|
|
return [
|
|
|
|
'id' => 'accounts-site-api',
|
|
|
|
'basePath' => dirname(__DIR__),
|
|
|
|
'bootstrap' => ['log'],
|
|
|
|
'controllerNamespace' => 'api\controllers',
|
2016-05-31 21:11:11 +03:00
|
|
|
'params' => $params,
|
2016-01-02 16:43:18 +03:00
|
|
|
'components' => [
|
|
|
|
'user' => [
|
2016-05-30 02:44:17 +03:00
|
|
|
'class' => \api\components\User\Component::class,
|
2016-05-12 11:50:30 +03:00
|
|
|
'identityClass' => \api\models\AccountIdentity::class,
|
2016-02-23 01:22:04 +03:00
|
|
|
'enableSession' => false,
|
2016-02-14 20:50:10 +03:00
|
|
|
'loginUrl' => null,
|
2016-05-30 02:44:17 +03:00
|
|
|
'secret' => $params['userSecret'],
|
2016-01-02 16:43:18 +03:00
|
|
|
],
|
|
|
|
'log' => [
|
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
|
|
|
'targets' => [
|
|
|
|
[
|
2016-05-12 11:50:30 +03:00
|
|
|
'class' => \yii\log\FileTarget::class,
|
2016-01-02 16:43:18 +03:00
|
|
|
'levels' => ['error', 'warning'],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
2016-01-03 03:18:37 +03:00
|
|
|
'request' => [
|
|
|
|
'baseUrl' => '/api',
|
|
|
|
],
|
|
|
|
'urlManager' => [
|
|
|
|
'enablePrettyUrl' => true,
|
|
|
|
'showScriptName' => false,
|
2016-01-21 00:14:29 +03:00
|
|
|
'rules' => require __DIR__ . '/routes.php',
|
2016-01-03 03:18:37 +03:00
|
|
|
],
|
2016-01-15 12:21:27 +03:00
|
|
|
'reCaptcha' => [
|
2016-05-31 21:11:11 +03:00
|
|
|
'class' => \api\components\ReCaptcha\Component::class,
|
2016-01-15 12:21:27 +03:00
|
|
|
],
|
2016-01-21 00:14:29 +03:00
|
|
|
'response' => [
|
|
|
|
'format' => \yii\web\Response::FORMAT_JSON,
|
|
|
|
],
|
2016-02-14 20:50:10 +03:00
|
|
|
'oauth' => [
|
|
|
|
'class' => \common\components\oauth\Component::class,
|
|
|
|
'grantTypes' => ['authorization_code'],
|
|
|
|
],
|
2016-01-02 16:43:18 +03:00
|
|
|
],
|
|
|
|
];
|