yii2-netdisk/config/web.php

76 lines
2.1 KiB
PHP
Raw Normal View History

2013-05-24 22:14:49 +08:00
<?php
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
2013-10-18 13:30:41 +08:00
$config = [
2014-03-16 12:46:16 +08:00
'id' => 'basic',
'basePath' => dirname(__DIR__),
2014-04-11 03:05:01 +08:00
'bootstrap' => ['log'],
2017-06-17 22:23:21 +08:00
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
2014-03-16 12:46:16 +08:00
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '',
],
2014-03-16 12:46:16 +08:00
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
2014-03-16 12:46:16 +08:00
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
2021-10-02 15:21:51 +08:00
// 'useFileTransport' to false and configure transport
// for the mailer to send real emails.
2014-03-16 12:46:16 +08:00
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
2014-03-16 12:46:16 +08:00
],
'params' => $params,
2013-10-18 13:30:41 +08:00
];
2013-08-10 19:56:40 +08:00
2013-12-18 13:40:52 +08:00
if (YII_ENV_DEV) {
2014-03-16 12:46:16 +08:00
// 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'],
];
2013-08-10 19:56:40 +08:00
}
return $config;