'basic', 'basePath' => dirname(__DIR__), 'sourceLanguage' => 'eng', 'language' => 'eng', 'timeZone' => 'Europe/Kiev', 'components' => [ 'db' => [ 'class' => 'app\\components\\db\\Connection', 'charset' => 'utf8' ], 'session' => [ 'name' => 'm2' ], 'urlManager' => [ 'enablePrettyUrl' => true, 'enableStrictParsing' => true, 'showScriptName' => false, 'rules' => [ // API ['class' => 'app\components\route\PropUrlRule', 'route' => 'prop/view'], ['class' => 'app\components\route\ThumbnailUrlRoute', 'route' => 'image/resize'], '' => 'site/index', 'sitemap.xml' => 'sitemap/index', 'debug/default/' => 'debug/default/', '//' => '//', '/' => '//', ], ], 'response' => [ 'class' => 'app\\components\\Response', 'format' => $ajaxRequest ? \yii\web\Response::FORMAT_JSON : \yii\web\Response::FORMAT_HTML ], 'request' => [ 'class' => 'app\\components\\Request', 'enableCsrfValidation' => true, 'csrfParam' => 'm2_csrf', ], 'cache' => [ 'class' => 'yii\\caching\\FileCache', ], 'user' => [ 'class' => 'yii\\web\\User', 'identityClass' => 'app\\models\\Users', 'loginUrl' => ['users/default/login'], ], 'errorHandler' => [ 'errorAction' => 'site/error', ], 'mail' => [ 'class' => 'yii\\swiftmailer\\Mailer', ], 'i18n' => [ 'translations' => [ 'yii' => [ 'class' => 'app\\components\\i18n\\PhpMessageSource', 'sourceLanguage' => 'eng', 'basePath' => '@app/messages', ], 'app' => [ 'class' => 'app\\components\\i18n\\PhpMessageSource', 'sourceLanguage' => 'eng', 'basePath' => '@app/messages', ], 'api' => [ 'class' => 'app\\components\\i18n\\PhpMessageSource', 'sourceLanguage' => 'eng', 'basePath' => '@app/messages', ], ], ], 'log' => [ //'traceLevel' => YII_DEBUG ? 3 : 0, 'class' => 'app\\components\\Logger', 'flushInterval' => 1, 'targets' => [ 'errorFile' => [ 'logFile' => '@app/runtime/logs/error.log', 'class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning'], 'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'], ], 'jsonErrorFile' => [ // неможна міняти назву, на неї завязаний SystemLogController 'logFile' => '@app/runtime/logs/error.jlog', 'class' => 'app\\components\\JsonFileTargetLogger', 'levels' => ['error', 'warning'], 'logVars' => ['_GET', '_POST', '_FILES', '_COOKIE', '_SESSION', '_SERVER'], ], 'infoFile' => [ 'logFile' => '@app/runtime/logs/info.log', 'class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning'], //'info', 'trace', 'profile' 'logVars' => [], ], // 'email' => [ // 'class' => 'yii\log\EmailTarget', // 'levels' => ['error'], // 'emails' => ['lazar@dev.adaptainc.com'], // ], ], ], 'authManager' => [ 'class' => 'app\\components\\PhpManager', 'defaultRoles' => ['guest'] ], ], 'modules' => [], 'params' => [ 'adminEmail' => 'lazar@dev.adaptainc.com', 'languages' => ['ukr' => 'Українська', 'rus' => 'Русский', 'eng' => 'English'], 'sqlFunctionSchemaCaching' => false, 'returnUrlSuffix' => '../source/app' ], ]; //if ('dev' === YII_ENV) { $config['extensions'] = require(__DIR__ . '/../vendor/yiisoft/extensions.php'); $config['modules']['gii'] = 'yii\\gii\\Module'; $config['preload'][] = 'debug'; $config['modules']['debug'] = [ 'class' => 'yii\\debug\\Module', 'allowedIPs' => ['127.0.0.1', '10.0.0.*'], ]; $config['components']['urlManager']['enableStrictParsing'] = false; //} if ('catzilla' === APP_SERVER) { $config['components']['db']['dsn'] = 'mysql:host=localhost;dbname=prj_m2_te_ua'; $config['components']['db']['username'] = 'dev'; $config['components']['db']['password'] = 'devpass'; $config['components']['log']['targets']['i18nFile'] = [ 'logFile' => '@app/runtime/logs/i18n.log', 'class' => 'yii\\log\\FileTarget', 'levels' => [], 'categories' => ['i18n'], 'logVars' => [], ]; } if ('local' === APP_SERVER) { $config['components']['db']['dsn'] = 'mysql:host=localhost;dbname=prj_m2_te_ua_preview'; $config['components']['db']['username'] = 'dev'; $config['components']['db']['password'] = 'devpass'; $config['params']['sqlFunctionSchemaCaching'] = false; $config['params']['returnUrlSuffix'] = ''; } if ('server1' === APP_SERVER) { $config['components']['db']['dsn'] = 'mysql:host=localhost;dbname=m2_db'; $config['components']['db']['username'] = 'm2_user'; $config['components']['db']['password'] = 'LwXlnk4hwADT'; // function caching is broken and causes SQL errors $config['params']['sqlFunctionSchemaCaching'] = false; $config['params']['returnUrlSuffix'] = ''; } return $config;