<?php require_once '../components/MainView.php'; require_once '../models/Languages.php'; use app\components\MainView; use app\models\Languages; $params = array_merge(require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'); $config = ['id' => 'basic', 'language' => 'en-US', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'defaultRoute' => 'site/login', 'aliases' => ['@file_save_dir' => '@app/web/files/', '@file_view_url' => '/files/', '@beacon_save_dir' => '@app/web/beacon_images/', '@beacon_view_url' => '/beacon_images', '@backend_beacon_view_dir' => '@app/web/beacon_images', '@frontend_beacon_view_dir' => '@app/web/beacon_images'], 'components' => ['cache' => ['class' => 'yii\\caching\\FileCache'], 'view' => ['class' => 'app\\components\\MainView'], 'user' => ['identityClass' => 'app\\models\\Users', 'enableAutoLogin' => true], 'assetManager' => ['bundles' => [\yii\web\JqueryAsset::className() => ['js' => ["http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", "http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"], 'jsOptions' => ['position' => MainView::POS_HEAD]], \yii\bootstrap\BootstrapAsset::className() => ['baseUrl' => '@web', 'basePath' => '@webroot', 'css' => ['css/bootstrap.min.css']], \yii\bootstrap\BootstrapPluginAsset::className() => ['js' => ['https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js']]], 'appendTimestamp' => true], 'errorHandler' => ['errorAction' => 'site/error'], 'urlManager' => ['enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => ['<controller:\\w+>/<id:\\d+>' => '<controller>/view', '<controller:\\w+>/<action:\\w+>/<id:\\d+>' => '<controller>/<action>', '<controller:\\w+>/<action:\\w+>' => '<controller>/<action>']], 'authManager' => ['class' => yii\rbac\DbManager::className(), 'cache' => 'cache', 'defaultRoles' => ['super_admin', 'admin', 'user', 'promo_user']], 'apcCache' => ['class' => yii\caching\MemCache::className()], 'mailer' => ['class' => '\\zyx\\phpmailer\\Mailer', 'viewPath' => '@app/mail', 'useFileTransport' => false, 'messageConfig' => ['from' => ['*****@*****.**' => 'Beacon CMS']]], 'log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => 'yii\\log\\FileTarget', 'levels' => ['error', 'warning']]]], 'session' => ['class' => 'yii\\web\\DbSession'], 'i18n' => ['translations' => ['*' => ['class' => 'yii\\i18n\\DbMessageSource', 'sourceLanguage' => 'en-US', 'forceTranslation' => true]]], 'languagepicker' => ['class' => '\\lajax\\languagepicker\\widgets\\LanguagePicker', 'languages' => function () { return Languages::getLanguageNames(true); }]], 'params' => $params]; return $config;
<?php return ['vendorPath' => dirname(dirname(__DIR__)) . '/vendor', 'aliases' => ['@file_save_dir' => '@common/files/', '@file_view_url' => '/files/'], 'components' => ['cache' => ['class' => 'yii\\caching\\FileCache'], 'assetManager' => ['appendTimestamp' => true], 'authManager' => ['class' => yii\rbac\DbManager::className(), 'cache' => 'cache', 'defaultRoles' => ['super_admin', 'admin', 'user']], 'view' => ['class' => 'common\\components\\MainView'], 'mailer' => ['class' => \zyx\phpmailer\Mailer::className(), 'viewPath' => '@common/mail', 'useFileTransport' => false, 'messageConfig' => ['from' => ['*****@*****.**']]], 'urlManager' => ['enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => ['<controller:\\w+>/<id:\\d+>' => '<controller>/view', '<controller:\\w+>/<action:\\w+>/<id:\\d+>' => '<controller>/<action>', '<controller:\\w+>/<action:\\w+>' => '<controller>/<action>']], 'session' => ['class' => 'yii\\web\\DbSession'], 'i18n' => ['translations' => ['*' => ['class' => 'yii\\i18n\\PhpMessageSource', 'basePath' => '@app/messages', 'sourceLanguage' => 'en-US']]]]];
<?php $languages = (require __DIR__ . '/languages.php'); $config = ['projectName' => 'My Project', 'RegistrationNeedsActivation' => false, 'LoginWithEmail' => true, 'ForceStrongPassword' => false, 'user.passwordResetTokenExpire' => 3600, 'adminEmail' => '*****@*****.**', 'supportEmail' => '*****@*****.**', 'app.urlManager' => ['class' => yii\web\UrlManager::className(), 'enablePrettyUrl' => true, 'showScriptName' => false], 'app.urlManager.localeUrls' => ['class' => codemix\localeurls\UrlManager::className(), 'enablePrettyUrl' => true, 'showScriptName' => false, 'enableDefaultLanguageUrlCode' => true, 'enableLanguagePersistence' => true, 'enableLanguageDetection' => true, 'languages' => $languages], 'app.giiModule' => ['class' => yii\gii\Module::className(), 'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*']], 'app.fileCache' => ['class' => yii\caching\FileCache::className()], 'app.redisCache' => [], 'app.assetManager' => ['appendTimestamp' => true, 'converter' => ['class' => common\assets\AppAssetConvertor::className()], 'bundles' => ['yii\\bootstrap\\BootstrapAsset' => ['css' => []]]], 'app.authManager' => ['class' => yii\rbac\DbManager::className(), 'cache' => 'cache'], 'app.mail' => ['class' => yii\swiftmailer\Mailer::className(), 'viewPath' => '@common/mails', 'useFileTransport' => true], 'app.i18n' => ['class' => uran1980\yii\modules\i18n\components\I18N::className(), 'languages' => $languages, 'format' => 'db', 'sourcePath' => [__DIR__ . '/../../frontend', __DIR__ . '/../../backend', __DIR__ . '/../../common'], 'messagePath' => __DIR__ . '/../../messages', 'translations' => ['*' => ['class' => yii\i18n\DbMessageSource::className(), 'enableCaching' => true, 'cachingDuration' => 60 * 60 * 2]]], 'app.debugModule' => ['class' => yii\debug\Module::className(), 'controllerMap' => ['default' => common\modules\debug\controllers\DefaultController::className()], 'panels' => ['log' => ['class' => common\modules\debug\panels\LogPanel::className()], 'dbLogs' => ['class' => common\modules\debug\panels\DbLogPanel::className()], 'views' => ['class' => common\modules\debug\panels\ViewsPanel::className()], 'devInfo' => ['class' => common\modules\debug\panels\DevInfoPanel::className()]]]]; return $config;