<?php
$params = require (__dir__. '/params.php ');
$config = [
' id ' = ' basic ',
' basepath ' = dirname (__dir__),
' bootstrap ' = [' log '],
' components ' = [
' request ' = [
//!!! Insert a secret key in the following (if it was empty)-this is required by cookie validation
' cookievalidationkey ' = ' ntpwryaesma71cuimp3inzmup5ofdiyt ',
' parsers ' = [
' application/json ' = ' yii\web\jsonparser ',
]
],
' 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 the to set
//' Usefiletransport ' to false and configure a transport
//For the mailer to send real emails.
' usefiletransport ' = True,
],
' log ' = [
' TraceLevel ' and yii_debug? 3:0,
' targets ' = [
[
' class ' = ' Yii\log\filetarget ',
' Levels ' = [' Error ', ' warning '],
],
],
],
' db ' = require (__dir__. '/db.php '),
' Urlmanager ' = [
' enableprettyurl ' = True,
' enablestrictparsing ' = false,//cannot be set to True
' showscriptname ' = False,
' rules ' = [
[' class ' = ' Yii\rest\urlrule ', ' controller ' = [' user ', ' post ']],
],
],
],
' params ' = $params,
' language ' = ' zh-cn ',
];
if (yii_env_dev) {
//configuration adjustments for ' Dev ' environment
$config [' Bootstrap '] [] = ' Debug ';
$config [' modules '] [' debug '] = ' yii\debug\module ';
$config [' Bootstrap '] [] = ' gii ';
//$config [' modules '] [' gii '] = ' yii\gii\module ';
$config [' modules '] [' gii '] = [
' class ' = ' Yii\gii\module ',
' allowedips ' = [' 127.0.0.1 ', ':: 1 ', ' 192.168.0.* ', ' 192.168.31.134 ']//adjust here as needed
];
}
return $config;
yii-basic-app-2.0.5/basic/config/web.php