Advertisement
ucupperz

Untitled

Dec 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <?php
  2.  
  3. $params = require __DIR__ . '/params.php';
  4. $db = require __DIR__ . '/db.php';
  5.  
  6. $config = [
  7. 'id' => 'basic',
  8. 'basePath' => dirname(__DIR__),
  9. 'bootstrap' => ['log'],
  10. 'aliases' => [
  11. '@bower' => '@vendor/bower-asset',
  12. '@npm' => '@vendor/npm-asset',
  13. ],
  14. 'components' => [
  15. 'request' => [
  16. 'parsers' => [
  17. 'application/json' => 'yii\web\JsonParser',
  18. ],
  19. // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  20. 'cookieValidationKey' => 'sRr15iD8J4ur39ppFq5sgofxhHKiS7OP',
  21. ],
  22. 'cache' => [
  23. 'class' => 'yii\caching\FileCache',
  24. ],
  25. 'user' => [
  26. 'identityClass' => 'app\models\User',
  27. 'enableAutoLogin' => true,
  28. 'enableSession' => false,
  29. ],
  30. 'errorHandler' => [
  31. 'errorAction' => 'site/error',
  32. ],
  33. 'mailer' => [
  34. 'class' => 'yii\swiftmailer\Mailer',
  35. // send all mails to a file by default. You have to set
  36. // 'useFileTransport' to false and configure a transport
  37. // for the mailer to send real emails.
  38. 'useFileTransport' => true,
  39. ],
  40. 'log' => [
  41. 'traceLevel' => YII_DEBUG ? 3 : 0,
  42. 'targets' => [
  43. [
  44. 'class' => 'yii\log\FileTarget',
  45. 'levels' => ['error', 'warning'],
  46. ],
  47. ],
  48. ],
  49. 'db' => $db,
  50. 'urlManager' => [
  51. 'enablePrettyUrl' => true,
  52. 'showScriptName' => false,
  53. 'rules' => [
  54. [
  55. 'class' => 'yii\rest\UrlRule',
  56. 'controller' => ['pegawai', 'absen', 'admin'],
  57. 'extraPatterns' => [
  58. 'POST login' => 'login',
  59.  
  60. ],
  61. ],
  62. ],
  63. ],
  64. ],
  65. 'params' => $params,
  66. ];
  67.  
  68. if (YII_ENV_DEV) {
  69. // configuration adjustments for 'dev' environment
  70. $config['bootstrap'][] = 'debug';
  71. $config['modules']['debug'] = [
  72. 'class' => 'yii\debug\Module',
  73. // uncomment the following to add your IP if you are not connecting from localhost.
  74. //'allowedIPs' => ['127.0.0.1', '::1'],
  75. ];
  76.  
  77. $config['bootstrap'][] = 'gii';
  78. $config['modules']['gii'] = [
  79. 'class' => 'yii\gii\Module',
  80. // uncomment the following to add your IP if you are not connecting from localhost.
  81. //'allowedIPs' => ['127.0.0.1', '::1'],
  82. ];
  83. }
  84.  
  85. return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement