Advertisement
ganryu

web.php

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