Esempio n. 1
0
<?php

use kartik\datecontrol\Module;
Yii::$container->set(\Zelenin\yii\modules\RequestLog\behaviors\RequestLogBehavior::className(), ['excludeRules' => [function () {
    list($route, $params) = Yii::$app->getRequest()->resolve();
    return $route === 'debug/default/toolbar';
}]]);
$params = (require __DIR__ . '/params.php');
$config = ['id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'timeZone' => 'Europe/Kiev', 'language' => 'ru', 'sourceLanguage' => 'en_US', 'components' => ['request' => ['cookieValidationKey' => 'chLUBv29-mcEJ1JBUDG-Iv8i1OVssfGb'], 'cache' => ['class' => 'yii\\caching\\FileCache'], 'user' => ['class' => 'amnah\\yii2\\user\\components\\User'], 'errorHandler' => ['errorAction' => 'site/error'], 'mailer' => ['class' => 'yii\\swiftmailer\\Mailer', 'useFileTransport' => true, 'messageConfig' => ['from' => ['admin@website.com' => 'Admin'], 'charset' => 'UTF-8']], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'db' => require __DIR__ . '/db.php', 'i18n' => array('translations' => array('main*' => array('class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => "@app/messages", 'sourceLanguage' => 'en_US', 'fileMap' => array('app' => 'app.php')), 'zelenin*' => array('class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => "@app/messages", 'sourceLanguage' => 'en_US', 'fileMap' => array('zelenin/modules/request-log' => 'modules.php')))), 'formatter' => ['class' => 'yii\\i18n\\Formatter', 'dateFormat' => 'dd.MM.y', 'datetimeFormat' => 'php:d.m.Y H:i:s', 'timeFormat' => 'php:H:i:s']], 'controllerMap' => ['file' => 'mdm\\upload\\FileController'], 'modules' => ['user' => ['class' => 'amnah\\yii2\\user\\Module'], 'datecontrol' => ['class' => 'kartik\\datecontrol\\Module', 'displaySettings' => [Module::FORMAT_DATE => 'dd.MM.y', Module::FORMAT_TIME => 'HH:mm:ss a', Module::FORMAT_DATETIME => 'dd.MM.y HH:mm:ss a'], 'saveSettings' => [Module::FORMAT_DATE => 'php:Y-m-d', Module::FORMAT_TIME => 'php:H:i:s', Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s'], 'autoWidget' => true, 'autoWidgetSettings' => [Module::FORMAT_DATE => ['type' => 2, 'pluginOptions' => ['autoclose' => true]], Module::FORMAT_DATETIME => [], Module::FORMAT_TIME => []]], 'request-log' => ['class' => Zelenin\yii\modules\RequestLog\Module::className(), 'usernameAttribute' => 'email'], 'gridview' => ['class' => '\\kartik\\grid\\Module']], 'params' => $params];
if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['bootstrap'][] = 'gii';
    $config['modules']['debug'] = ['class' => 'yii\\debug\\Module', 'allowedIPs' => ['*']];
    $config['modules']['gii'] = ['class' => 'yii\\gii\\Module', 'allowedIPs' => ['*']];
}
return $config;
 /**
  * @inheritdoc
  */
 public function bootstrap($app)
 {
     $app->attachBehavior('request-log', RequestLogBehavior::className());
 }