2016-01-02 19:13:18 +05:30
|
|
|
<?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',
|
|
|
|
'components' => [
|
|
|
|
'user' => [
|
2016-05-30 05:14:17 +05:30
|
|
|
'class' => \api\components\User\Component::class,
|
2016-05-12 14:20:30 +05:30
|
|
|
'identityClass' => \api\models\AccountIdentity::class,
|
2016-02-23 03:52:04 +05:30
|
|
|
'enableSession' => false,
|
2016-02-14 23:20:10 +05:30
|
|
|
'loginUrl' => null,
|
2016-05-30 05:14:17 +05:30
|
|
|
'secret' => $params['userSecret'],
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
'log' => [
|
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0,
|
|
|
|
'targets' => [
|
|
|
|
[
|
2016-05-12 14:20:30 +05:30
|
|
|
'class' => \yii\log\FileTarget::class,
|
2016-01-02 19:13:18 +05:30
|
|
|
'levels' => ['error', 'warning'],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
'errorHandler' => [
|
|
|
|
'errorAction' => 'site/error',
|
|
|
|
],
|
2016-01-03 05:48:37 +05:30
|
|
|
'request' => [
|
|
|
|
'baseUrl' => '/api',
|
|
|
|
],
|
|
|
|
'urlManager' => [
|
|
|
|
'enablePrettyUrl' => true,
|
|
|
|
'showScriptName' => false,
|
2016-01-21 02:44:29 +05:30
|
|
|
'rules' => require __DIR__ . '/routes.php',
|
2016-01-03 05:48:37 +05:30
|
|
|
],
|
2016-01-15 14:51:27 +05:30
|
|
|
'reCaptcha' => [
|
|
|
|
'class' => 'api\components\ReCaptcha\Component',
|
|
|
|
],
|
2016-01-21 02:44:29 +05:30
|
|
|
'response' => [
|
|
|
|
'format' => \yii\web\Response::FORMAT_JSON,
|
|
|
|
],
|
2016-02-14 23:20:10 +05:30
|
|
|
'oauth' => [
|
|
|
|
'class' => \common\components\oauth\Component::class,
|
|
|
|
'grantTypes' => ['authorization_code'],
|
|
|
|
],
|
2016-01-02 19:13:18 +05:30
|
|
|
],
|
|
|
|
'params' => $params,
|
|
|
|
];
|