BiFace_Server_Lite/config/web.php
2020-03-27 10:13:51 +07:00

144 lines
4.3 KiB
PHP

<?php
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$config = [
'id' => 'basic',
'homeUrl' => ['/dashboard'],
'name' => 'AIParking Server',
'defaultRoute' => 'dashboard',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'timeZone' => 'Asia/Ho_Chi_Minh',
'language' => 'vi-VN',
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'modules' => [
'rbac' => [
'class' => 'yii2mod\rbac\Module',
],
],
'components' => [
'authManager' => [
'class' => 'yii\rbac\DbManager', //'app\components\CacheRbacDbManager',
'defaultRoles' => ['guest', 'user'],
],
'mongodb' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://localhost:27017/human',
],
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
],
],
'defaultExtension' => 'tpl',
'renderers' => [
'tpl' => [
'class' => 'yii\smarty\ViewRenderer',
//'cachePath' => '@runtime/Smarty/cache',
],
],
],
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-blue',
],
],
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'eqHsmuZKxCrVYfeBbpt5suJvVHafnK7O',
'enableCsrfValidation' => false,
'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',
'view' => [
'defaultExtension' => 'tpl',
'renderers' => [
'tpl' => [
'class' => 'yii\smarty\ViewRenderer',
'cachePath' => '@runtime/Smarty/cache',
],
],
],
'viewPath' => '@app/mail',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => 'sunrise.media.apps@gmail.com',
'password' => 'admin@123456',
'port' => '587',
'encryption' => 'tls', //ssl use post 465
],
'useFileTransport' => false,
],
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@app/messages',
//'sourceLanguage' => 'en-US',
'fileMap' => []
],
],
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// 'allowedIPs' => ['127.0.0.1', '::1'],
'allowedIPs' => ['*'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// 'allowedIPs' => ['127.0.0.1', '::1'],
'allowedIPs' => ['*'],
'generators' => [
'crud' => [
'class' => 'yii\gii\generators\crud\Generator',
'templates' => [
'adminlte' => '@vendor/dmstr/yii2-adminlte-asset/gii/templates/crud/simple',
]
]
],
];
}
return $config;