示例#1
0
文件: main.php 项目: snivs/semanti
<?php

// @see https://github.com/yiisoft/yii2/blob/master/docs/guide/concept-configurations.md
use yii\helpers\ArrayHelper;
use common\components\log\AppLogger;
$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-console', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'console\\controllers', 'controllerMap' => ['message' => console\controllers\MessageController::className()], 'modules' => [], 'components' => ['i18n' => $params['app.i18n'], 'log' => ['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_CONSOLE], 'logTable' => 'log']]]], 'params' => $params];
// configuration adjustments for 'dev' environment
if (!YII_ENV_TEST && !YII_ENV_PROD) {
    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = $params['app.giiModule'];
}
return $config;
示例#2
0
文件: main.php 项目: snivs/semanti
<?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;
$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-frontend', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'frontend\\modules\\site\\controllers', 'controller' => '@frontend/modules/site/IndexController', 'defaultRoute' => 'site/index/index', 'layout' => '@frontend/layouts/main.php', 'modules' => ['site' => frontend\modules\site\Module::className(), 'profile' => frontend\modules\profile\Module::className()], 'components' => ['urlManager' => $params['app.urlManager.localeUrls'], 'urlManagerBackend' => $params['app.urlManagerBackend'], 'view' => $params['app.view'], '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_FRONTEND, AppLogger::CATEGORY_PROFILE, AppLogger::CATEGORY_SITE], 'logTable' => 'log']]], 'errorHandler' => ['class' => yii\web\ErrorHandler::className(), 'errorAction' => 'site/index/error']], 'params' => $params];
if (YII_ENV_DEV) {
    $config['modules']['test'] = frontend\modules\test\Module::className();
}
return $config;
示例#3
0
文件: main.php 项目: snivs/semanti
<?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;