Blame view

config/web.php 2.75 KB
2049c43e   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
  <?php
      
      $params = require __DIR__ . '/params.php';
      $db = require __DIR__ . '/db.php';
      
      $config = [
          'id'         => 'basic',
          'homeUrl'    => '/',
          'basePath'   => dirname(__DIR__),
          'bootstrap'  => [ 'log' ],
          'aliases'    => [
              '@bower' => '@vendor/bower-asset',
              '@npm'   => '@vendor/npm-asset',
          ],
          'components' => [
              'request'      => [
                  // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
                  'cookieValidationKey' => 'Ss-uV-PyprNBSMTEEInjXR9ogP31Z8Gv',
                  'baseUrl'             => '/',
              ],
              'cache'        => [
                  'class' => 'yii\caching\FileCache',
              ],
              'user'         => [
                  'identityClass'   => 'app\models\User',
                  'enableAutoLogin' => true,
              ],
              'errorHandler' => [
                  'errorAction' => 'site/error',
              ],
              'mailer'       => [
                  'class'            => 'yii\swiftmailer\Mailer',
                  // send all mails to a file by default. You have to set
                  // 'useFileTransport' to false and configure a transport
                  // for the mailer to send real emails.
                  'useFileTransport' => true,
              ],
              'log'          => [
                  'traceLevel' => YII_DEBUG ? 3 : 0,
                  'targets'    => [
                      [
                          'class'  => 'yii\log\FileTarget',
                          'levels' => [
                              'error',
                              'warning',
                          ],
                      ],
                  ],
              ],
              'db'           => $db,
9568083b   Alexey Boroda   -Backend left
51
              'urlManager'   => [
2049c43e   Alexey Boroda   first commit
52
                  'enablePrettyUrl' => true,
9568083b   Alexey Boroda   -Backend left
53
54
55
                  'showScriptName'  => false,
                  'rules'           => [
                      'subscribe' => 'site/subscribe',
2049c43e   Alexey Boroda   first commit
56
57
                  ],
              ],
2049c43e   Alexey Boroda   first commit
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
          ],
          'params'     => $params,
      ];
      
      if (YII_ENV_DEV) {
          // configuration adjustments for 'dev' environment
          $config[ 'bootstrap' ][] = 'debug';
          $config[ 'modules' ][ 'debug' ] = [
              'class' => 'yii\debug\Module',
              // uncomment the following to add your IP if you are not connecting from localhost.
              //'allowedIPs' => ['127.0.0.1', '::1'],
          ];
          
          $config[ 'bootstrap' ][] = 'gii';
          $config[ 'modules' ][ 'gii' ] = [
              'class' => 'yii\gii\Module',
              // uncomment the following to add your IP if you are not connecting from localhost.
              //'allowedIPs' => ['127.0.0.1', '::1'],
          ];
      }
      
      return $config;