Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 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. // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  17. 'cookieValidationKey' => 'aBusRGUHUCZR-AUQ-5w6HuoA_8mMNB0p',
  18. ],
  19. 'cache' => [
  20. 'class' => 'yii\caching\FileCache',
  21. ],
  22. 'user' => [
  23. 'identityClass' => 'app\models\User',
  24. 'enableAutoLogin' => true,
  25. ],
  26. 'errorHandler' => [
  27. 'errorAction' => 'site/error',
  28. ],
  29. 'mailer' => [
  30. 'class' => 'yii\swiftmailer\Mailer',
  31. // send all mails to a file by default. You have to set
  32. // 'useFileTransport' to false and configure a transport
  33. // for the mailer to send real emails.
  34. 'useFileTransport' => true,
  35. ],
  36. 'log' => [
  37. 'traceLevel' => YII_DEBUG ? 3 : 0,
  38. 'targets' => [
  39. [
  40. 'class' => 'yii\log\FileTarget',
  41. 'levels' => ['error', 'warning'],
  42. ],
  43. ],
  44. ],
  45. 'db' => $db,
  46. 'urlManager' => [
  47. 'enablePrettyUrl' => true,
  48. 'showScriptName' => false,
  49. 'rules' => [
  50. '/' => 'site/index',
  51. 'about' => 'site/about',
  52. 'contact' => 'site/contact',
  53. 'login' => 'site/login',
  54. 'company' => 'company/index',
  55. 'company/<id:\d+>' => 'company/show'
  56. ],
  57. ]
  58. ],
  59. 'params' => $params,
  60. //
  61. ];
  62.  
  63. if (YII_ENV_DEV) {
  64. // configuration adjustments for 'dev' environment
  65. $config['bootstrap'][] = 'debug';
  66. $config['modules']['debug'] = [
  67. 'class' => 'yii\debug\Module',
  68. // uncomment the following to add your IP if you are not connecting from localhost.
  69. //'allowedIPs' => ['127.0.0.1', '::1'],
  70. ];
  71.  
  72. $config['bootstrap'][] = 'gii';
  73. $config['modules']['gii'] = [
  74. 'class' => 'yii\gii\Module',
  75. // uncomment the following to add your IP if you are not connecting from localhost.
  76. //'allowedIPs' => ['127.0.0.1', '::1'],
  77. ];
  78. }
  79.  
  80. return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement