1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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' => 'app-api',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log'],
- 'modules' => [
- 'v1' => [
- 'class' => 'api\modules\v1\Module'
- ],
- 'v2' => [
- 'class' => 'api\modules\v2\Module'
- ],
- ],
- 'controllerNamespace' => 'api\controllers',
- 'components' => [
- 'user' => [
- 'identityClass' => 'common\models\User',
- 'enableAutoLogin' => false, // API change to false
- 'enableSession' => false, // API ++
- 'loginUrl' => null // API ++
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- ],
- ],
- ],
- 'request' => [
- //'class' => '\yii\web\Request',
- //'enableCookieValidation' => false,
- //'parsers' => [
- // 'application/json' => 'yii\web\JsonParser',
- //],
- 'baseUrl' => '/api',
- 'cookieValidationKey' => 'O1d232trde1xww-M97_7QvwPo-5QGdkLMp#@#@',
- ],
- /*'errorHandler' => [
- 'errorAction' => 'site/error',
- ],*/
- 'urlManager' => [
- 'enablePrettyUrl' => true,
- 'enableStrictParsing' => true,
- 'showScriptName' => false,
- 'rules' => [
- [
- 'class' => 'yii\rest\UrlRule',
- 'controller' => [
- 'v1/site'
- ]
- ],
- [
- 'class' => 'yii\rest\UrlRule',
- 'controller' => [
- 'v2/site'
- ]
- ]
- ],
- ],
- 'db' => require __DIR__ . '/../../common/config/db.php'
- ],
- 'params' => $params,
- ];
|