You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.6 KiB

5 years ago
  1. <?php
  2. $params = array_merge(
  3. require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'
  4. );
  5. return [
  6. 'id' => 'api',
  7. 'basePath' => dirname(__DIR__),
  8. 'controllerNamespace' => 'api\controllers',
  9. 'bootstrap' => ['log'],
  10. 'modules' => [],
  11. 'components' => [
  12. 'request' => [
  13. 'parsers' => [
  14. 'application/json' => 'yii\web\JsonParser',
  15. ],
  16. 'csrfParam' => '_csrf-backend',
  17. ],
  18. 'user' => [
  19. 'identityClass' => 'common\models\User',
  20. 'enableAutoLogin' => true,
  21. 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
  22. ],
  23. 'session' => [
  24. // this is the name of the session cookie used for login on the app
  25. 'name' => 'advanced-api',
  26. ],
  27. 'log' => [
  28. 'traceLevel' => YII_DEBUG ? 3 : 0,
  29. 'targets' => [
  30. [
  31. 'class' => 'yii\log\FileTarget',
  32. 'levels' => ['error', 'warning'],
  33. ],
  34. ],
  35. ],
  36. 'errorHandler' => [
  37. 'errorAction' => 'site/error',
  38. ],
  39. 'urlManager' => [
  40. 'enablePrettyUrl' => true,
  41. 'showScriptName' => true,
  42. 'enableStrictParsing' => false,
  43. 'rules' => [
  44. ['class' => 'yii\rest\UrlRule', 'controller' => 'test'],
  45. ],
  46. ],
  47. ],
  48. 'params' => $params,
  49. ];