常中蝎 2016-02-19 15:05:33 3325次浏览 0条回复 5 0 0
<?php
$params = array_merge(
    require(__DIR__ . '/../../../common/config/params.php'),
    require(__DIR__ . '/params.php')
);

$config = [
    'id' => 'backend',
    'name' => 'backend',
    'timeZone'=>'Asia/Shanghai',
    'language'=>'zh-CN',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'apps\backend\controllers',
    'defaultRoute' => 'dashboard',
    'bootstrap' => ['gii'],
    'modules' => ['gii' => 'yii\gii\Module',],
    'components' => [
        'assetManager' => [
            'bundles' => [
                'yii\web\JqueryAsset' => [
                    'sourcePath' => null,
                    'js' => []
                ],
            ],
        ],
        'cache'=> [
            'class'=> 'yii\caching\FileCache',
        ],
        'admin' => [
            'class'             => '\yii\web\User',
            'identityClass'     => 'apps\backend\models\AdminUser',
            'idParam'           => '_aId',
            'identityCookie'    => ['name'=>'_aa','httpOnly' => true],
        ],
        'session' => [
            'cookieParams' => ['domain' => '.abc.com', 'lifetime' => 0],
            'timeout' => 0,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'error',
        ],
        'request' => [
            'enableCookieValidation' => true,
            'cookieValidationKey' => '8GONNLra_k99w5dOURXuc3bFuWN5WqJm',
        ],
        'urlManager' => [
            'class' => 'yii\web\UrlManager',
            'enablePrettyUrl' => true,
            'enableStrictParsing' => true,
            'showScriptName' => false,
            'rules' => [
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],
        'mailer' =>[
            'class' => 'yii\swiftmailer\Mailer',
            'viewPath' => '@common/mail',
            // 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' => false,
            'transport' => [
                'class' => 'Swift_SmtpTransport',
                'host' => 'smtp.exmail.qq.com',
                'username' => '',
                'password' => '',
                'port' => '465',
                'encryption' => 'ssl',

            ],
            'messageConfig'=>[
                'charset'=>'UTF-8',
                'from'=>['422396350@qq.com' => '常岳']
            ],
        ]

    ],
    'params' => $params,
];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = 'yii\debug\Module';

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'allowedIPs'=> ['127.0.0.1', '::1']
    ];
}

return $config;
    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册