98 lines
2.9 KiB
PHP
Raw Normal View History

2013-05-24 10:14:49 -04:00
<?php
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
2013-10-18 07:30:41 +02:00
$config = [
2014-03-16 10:46:16 +06:00
'id' => 'basic',
2024-02-15 11:08:46 +08:00
'name' =>'网盘',
2024-02-15 12:09:59 +08:00
// 'language' => 'zh-CN',
2014-03-16 10:46:16 +06:00
'basePath' => dirname(__DIR__),
2014-04-10 15:05:01 -04:00
'bootstrap' => ['log'],
2017-06-17 17:23:21 +03:00
'aliases' => [
'@bower' => '@vendor/bower-asset',
2024-02-09 12:15:09 +08:00
'@npm' => '@vendor/npm-asset',
2017-06-17 17:23:21 +03:00
],
2014-03-16 10:46:16 +06:00
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
2024-02-09 12:15:09 +08:00
'cookieValidationKey' => '9vuTNyfQqTOWY8fhAajrAhOfX_uaZqZZ',
],
// 'cache' => [
// 'class' => 'yii\caching\FileCache',
// ],
2014-03-16 10:46:16 +06:00
'cache' => [
'class' => 'yii\redis\Cache',
2014-03-16 10:46:16 +06:00
],
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => true,
'loginUrl' => ['user/login'], // 登录地址
2014-03-16 10:46:16 +06:00
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
2014-03-16 10:46:16 +06:00
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'session' => [
'class' => 'yii\redis\Session',
],
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,
],
'db' => $db,
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
2014-03-16 10:46:16 +06:00
],
'params' => $params,
2013-10-18 07:30:41 +02:00
];
2013-08-10 07:56:40 -04:00
2013-12-18 00:40:52 -05:00
if (YII_ENV_DEV) {
2014-03-16 10:46:16 +06: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.
2024-02-09 12:15:09 +08:00
'allowedIPs' => ['127.0.0.1', '::1', '192.168.1.*'],
'generators' => [ //自定义生成器
'rest-model' => [ // generator name
'class' => 'bestyii\giiRest\generators\model\Generator', // generator class
],
'rest-crud' => [ // generator name
'class' => 'bestyii\giiRest\generators\crud\Generator', // generator class
]
],
];
2013-08-10 07:56:40 -04:00
}
return $config;