Drupal investigation

web.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. $params = require(__DIR__ . '/params.php');
  3. $db = require(__DIR__ . '/db.php');
  4. $config = [
  5. 'id' => 'basic',
  6. 'basePath' => dirname(__DIR__),
  7. 'bootstrap' => ['log'],
  8. 'components' => [
  9. 'i18n' => [
  10. 'translations' => [
  11. 'app*' => [
  12. 'class' => 'yii\i18n\PhpMessageSource',
  13. 'fileMap' => [
  14. 'app' => 'app.php',
  15. 'app/error' => 'error.php'
  16. ],
  17. ],
  18. ],
  19. ],
  20. 'request' => [
  21. // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  22. 'cookieValidationKey' => 'ILovePizza',
  23. ],
  24. 'cache' => [
  25. 'class' => 'yii\caching\FileCache',
  26. ],
  27. 'user' => [
  28. 'identityClass' => 'app\models\TestUsers',
  29. 'enableAutoLogin' => false,
  30. ],
  31. 'errorHandler' => [
  32. 'errorAction' => 'site/error',
  33. ],
  34. 'mailer' => [
  35. 'class' => 'yii\swiftmailer\Mailer',
  36. // send all mails to a file by default. You have to set
  37. // 'useFileTransport' to false and configure a transport
  38. // for the mailer to send real emails.
  39. 'useFileTransport' => true,
  40. ],
  41. 'log' => [
  42. 'traceLevel' => YII_DEBUG ? 3 : 0,
  43. 'targets' => [
  44. [
  45. 'class' => 'yii\log\FileTarget',
  46. 'levels' => ['error', 'warning'],
  47. ],
  48. ],
  49. ],
  50. 'db' => $db,
  51. 'authManager' => [
  52. 'class' => 'yii\rbac\DbManager',
  53. ],
  54. /*'view' => [
  55. 'renderers' => [
  56. 'twig' => [
  57. 'class' => 'yii\twig\ViewRenderer',
  58. 'cachePath' => false,
  59. 'options' => [
  60. 'auto_reload' => true,
  61. ],
  62. 'globals' => [
  63. 'html' => '\yii\helpers\Html',
  64. ],
  65. ]
  66. ]
  67. ],*/
  68. /*
  69. 'urlManager' => [
  70. 'enablePrettyUrl' => true,
  71. 'showScriptName' => false,
  72. 'rules' => [
  73. ],
  74. ],*/
  75. ],
  76. 'modules' => [
  77. 'admin' => [
  78. 'class' => 'mdm\admin\Module',
  79. ],
  80. ],
  81. 'as access' => [
  82. 'class' => 'mdm\admin\components\AccessControl',
  83. 'allowActions' => [
  84. '/site/login',
  85. ],
  86. ],
  87. 'params' => $params,
  88. 'language' => 'en',
  89. 'sourceLanguage' => 'en',
  90. ];
  91. if (YII_ENV_DEV) {
  92. //$config['layout'] = 'main.twig';
  93. // configuration adjustments for 'dev' environment
  94. $config['bootstrap'][] = 'debug';
  95. $config['modules']['debug'] = [
  96. 'class' => 'yii\debug\Module',
  97. // uncomment the following to add your IP if you are not connecting from localhost.
  98. 'allowedIPs' => ['*'],//['127.0.0.1','176.9.94.228', '::1'],
  99. ];
  100. $config['bootstrap'][] = 'gii';
  101. $config['modules']['gii'] = [
  102. 'class' => 'yii\gii\Module',
  103. // uncomment the following to add your IP if you are not connecting from localhost.
  104. 'allowedIPs' => ['127.0.0.1','176.9.94.228', '::1'],
  105. ];
  106. }
  107. return $config;