Esempio n. 1
0
<?php

// @see https://github.com/yiisoft/yii2/blob/master/docs/guide/concept-configurations.md
use yii\helpers\ArrayHelper;
$params = ArrayHelper::merge(require __DIR__ . '/params.php', require __DIR__ . '/params-local.php');
$config = ['vendorPath' => dirname(dirname(dirname(__DIR__))) . '/vendor', 'language' => 'en', 'components' => ['db' => require __DIR__ . '/multidb/db.php', 'dbLogger' => require __DIR__ . '/multidb/dbLogger.php', 'cache' => $params['app.fileCache'], 'mail' => $params['app.mail'], 'urlManager' => $params['app.urlManager'], 'assetManager' => $params['app.assetManager'], 'authManager' => $params['app.authManager'], 'i18n' => $params['app.i18n'], 'session' => ['class' => yii\web\DbSession::className()], 'user' => ['class' => yii\web\User::className(), 'identityClass' => common\models\identity\UserIdentity::className(), 'enableAutoLogin' => true, 'loginUrl' => '/login']]];
// configuration adjustments for 'dev' environment
if (!YII_ENV_TEST && !YII_ENV_PROD) {
    $config['bootstrap'][] = 'debug';
    $config['bootstrap'][] = 'gii';
    $config['modules']['debug'] = $params['app.debugModule'];
    $config['modules']['gii'] = $params['app.giiModule'];
}
return $config;
Esempio n. 2
0
<?php

// Docs links:
// 1) https://github.com/yiisoft/yii2/blob/master/docs/guide/concept-configurations.md
// 2) https://github.com/yiisoft/yii2/blob/master/docs/guide/structure-controllers.md#default-controller-
use yii\helpers\ArrayHelper;
use common\components\log\AppLogger;
use common\rbac\AccessControl;
$params = ArrayHelper::merge(require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php');
$config = ['id' => 'app-backend', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'backend\\modules\\backend\\controllers', 'controller' => '@backend/modules/backend/IndexController', 'defaultRoute' => 'backend/index/index', 'layout' => '@backend/layouts/main.php', 'modules' => ['backend' => backend\modules\backend\Module::className(), 'i18n' => ['class' => uran1980\yii\modules\i18n\Module::className(), 'controllerMap' => ['default' => uran1980\yii\modules\i18n\controllers\DefaultController::className()], 'as access' => ['class' => AccessControl::className(), 'rules' => [['controllers' => ['i18n/default'], 'actions' => ['index', 'save', 'update', 'rescan', 'clear-cache', 'delete', 'restore'], 'allow' => true, 'roles' => [AccessControl::ROLE_TRANSLATOR]]]]]], 'components' => ['urlManager' => $params['app.urlManager.localeUrls'], 'urlManagerFrontend' => $params['app.urlManagerFrontend'], 'view' => $params['app.view'], 'user' => ['class' => yii\web\User::className(), 'identityClass' => common\models\identity\UserIdentity::className(), 'enableAutoLogin' => true, 'loginUrl' => '/backend/login'], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => ['file' => ['class' => yii\log\FileTarget::className(), 'levels' => ['error', 'warning']], 'dbLogger' => ['class' => common\components\log\AppLoggerDbTarget::className(), 'levels' => ['info', 'error', 'warning'], 'logVars' => ['_GET', '_POST'], 'categories' => [AppLogger::CATEGORY_APPLICATION, AppLogger::CATEGORY_TEST, AppLogger::CATEGORY_BACKEND], 'logTable' => 'log']]], 'errorHandler' => ['class' => yii\web\ErrorHandler::className(), 'errorAction' => 'backend/index/error']], 'params' => $params];
return $config;