Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- web.php
- <?php
- $params = require __DIR__ . '/params.php';
- $db = require __DIR__ . '/db.php';
- $config = [
- 'id' => 'basic',
- 'basePath' => dirname(__DIR__),
- 'bootstrap' => ['log'],
- 'language' => 'en',
- 'sourceLanguage' => 'en_GB',
- 'aliases' => [
- '@bower' => '@vendor/bower-asset',
- '@npm' => '@vendor/npm-asset',
- ],
- 'components' => [
- 'seo' => [
- 'class' => 'cinghie\seo\Seo'
- ],
- 'i18n' => [
- 'translations' => [
- 'traits' => [
- 'class' => 'yii\i18n\PhpMessageSource',
- 'basePath' => '@vendor/cinghie/yii2-traits/messages',
- ],
- ],
- ],
- 'view' => [
- 'theme' => [
- 'pathMap' => [
- '@dektrium/rbac/views/permission' => '@vendor/cinghie/yii2-user-extended/views/permission',
- '@dektrium/rbac/views/role' => '@vendor/cinghie/yii2-user-extended/views/role',
- '@dektrium/rbac/views/rule' => '@vendor/cinghie/yii2-user-extended/views/rule',
- '@dektrium/user/views/admin' => '@vendor/cinghie/yii2-user-extended/views/admin',
- '@dektrium/user/views/profile' => '@vendor/cinghie/yii2-user-extended/views/profile',
- '@dektrium/user/views/role' => '@vendor/cinghie/yii2-user-extended/views/role',
- '@dektrium/user/views/security' => '@vendor/cinghie/yii2-user-extended/views/adminlte/security',
- '@dektrium/user/views/settings' => '@vendor/cinghie/yii2-user-extended/views/settings',
- '@dektrium/rbac/views' => '@vendor/cinghie/yii2-user-extended/views',
- '@dektrium/user/views' => '@vendor/cinghie/yii2-user-extended/views',
- ],
- ],
- ],
- 'authClientCollection' => [
- 'class' => yii\authclient\Collection::className(),
- 'clients' => [
- 'facebook' => [
- 'class' => 'dektrium\user\clients\Facebook',
- 'clientId' => '348751238839346',
- 'clientSecret' => '8707a527f9e1c4ebf00ba0dc35252c25',
- ],
- 'twitter' => [
- 'class' => 'dektrium\user\clients\Twitter',
- 'consumerKey' => 'CONSUMER_KEY',
- 'consumerSecret' => 'CONSUMER_SECRET',
- ],
- 'github' => [
- 'class' => 'dektrium\user\clients\GitHub',
- 'clientId' => 'a85f204e7683f96b7d75',
- 'clientSecret' => '1bb63620191b46ada14e1c4a407ceaca203eae50',
- ],
- 'vkontakte' => [
- 'class' => 'dektrium\user\clients\VKontakte',
- 'clientId' => 'CLIENT_ID',
- 'clientSecret' => 'CLIENT_SECRET',
- ],
- 'google' => [
- 'class' => 'dektrium\user\clients\Google',
- 'clientId' => 'CLIENT_ID',
- 'clientSecret' => 'CLIENT_SECRET',
- ],
- ],
- ],
- 'request' => [
- // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
- 'cookieValidationKey' => 'Q0fRZJlh3uKlhXhPvxUFrHV_ZPvDlm4n',
- ],
- 'cache' => [
- 'class' => 'yii\caching\FileCache',
- ],
- //
- 'errorHandler' => [
- 'errorAction' => 'site/error',
- ],
- 'mailer' => [
- 'class' => 'yii\swiftmailer\Mailer',
- 'useFileTransport' => false,
- 'transport' => [
- 'class' => 'Swift_SmtpTransport',
- 'host' => 'smtp.yandex.ru',
- 'username' => '',
- 'password' => '',
- 'port' => '587',
- 'encryption' => 'tls',
- ],
- ],
- 'log' => [
- 'traceLevel' => YII_DEBUG ? 3 : 0,
- 'targets' => [
- [
- 'class' => 'yii\log\FileTarget',
- 'levels' => ['error', 'warning'],
- ],
- ],
- ],
- 'db' => $db,
- 'urlManager' => [
- //
- 'class' => 'codemix\localeurls\UrlManager',
- 'languages' => ['en', 'it', 'fr', 'de', 'es'],
- // 'class' => 'yii\web\UrlManager',
- // Disable index.php .
- 'showScriptName' => false,
- // Disable r= routes
- 'enablePrettyUrl' => true,
- 'rules' => [
- '<id:\d+>/<alias:[A-Za-z0-9 -_.]+>' => 'articles/categories/view',
- '<cat>/<id:\d+>/<alias:[A-Za-z0-9 -_.]+>' => 'articles/items/view',
- '<controller:\w+>/<id:\d+>'=>'<controller>/view',
- '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
- '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
- ],
- ],
- ],
- 'modules' => [
- // Module Articles
- 'articles' => [
- 'class' => 'cinghie\articles\Articles',
- 'userClass' => 'dektrium\user\models\User',
- // Select Languages allowed
- 'languages' => [
- "it-IT" => "it-IT",
- "en-GB" => "en-GB"
- ],
- // Select Date Format
- 'dateFormat' => 'd F Y',
- // Select Editor: no-editor, ckeditor, imperavi, markdown, tinymce
- 'editor' => 'ckeditor',
- // Select Path To Upload Category Image
- 'categoryImagePath' => '@webroot/img/articles/categories/',
- // Select URL To Upload Category Image
- 'categoryImageURL' => '@web/img/articles/categories/',
- // Select Path To Upload Category Thumb
- 'categoryThumbPath' => '@webroot/img/articles/categories/thumb/',
- // Select URL To Upload Category Image
- 'categoryThumbURL' => '@web/img/articles/categories/thumb/',
- // Select Path To Upload Item Image
- 'itemImagePath' => '@webroot/img/articles/items/',
- // Select URL To Upload Item Image
- 'itemImageURL' => '@web/img/articles/items/',
- // Select Path To Upload Item Thumb
- 'itemThumbPath' => '@webroot/img/articles/items/thumb/',
- // Select URL To Upload Item Thumb
- 'itemThumbURL' => '@web/img/articles/items/thumb/',
- // Select Path To Upload Attachments
- 'attachPath' => '@webroot/attachments/',
- // Select URL To Upload Attachment
- 'attachURL' => '@web/img/articles/items/',
- // Select Image Types allowed
- 'attachType' => ['jpg','jpeg','gif','png','csv','pdf','txt','doc','docs'],
- // Select Image Name: categoryname, original, casual
- 'imageNameType' => 'categoryname',
- // Select Image Types allowed
- 'imageType' => ['png','jpg','jpeg'],
- // Thumbnails Options
- 'thumbOptions' => [
- 'small' => ['quality' => 100, 'width' => 150, 'height' => 100],
- 'medium' => ['quality' => 100, 'width' => 200, 'height' => 150],
- 'large' => ['quality' => 100, 'width' => 300, 'height' => 250],
- 'extra' => ['quality' => 100, 'width' => 400, 'height' => 350],
- ],
- // Show Titles in the views
- 'showTitles' => true,
- ],
- // Module Kartik-v Grid
- 'gridview' => [
- 'class' => '\kartik\grid\Module',
- ],
- //depends extensions
- 'markdown' => [
- 'class' => 'kartik\markdown\Module',
- ],
- // Yii2 RBAC
- 'rbac' => [
- 'class' => 'dektrium\rbac\RbacWebModule'
- ],
- // Yii2 User
- 'user' => [
- 'class' => 'dektrium\user\Module',
- 'adminPermission' => 'role, permission',
- 'admins'=>['admin'],
- 'enableUnconfirmedLogin' => false,//boolean
- 'confirmWithin' => 21600,//integer
- 'cost' => 12, //integer
- // ],
- 'controllerMap' => [
- 'admin' => 'cinghie\userextended\controllers\AdminController',
- 'settings' => 'cinghie\userextended\controllers\SettingsController'
- ],
- // Yii2 User Models Overrides
- 'modelMap' => [
- 'RegistrationForm' => 'cinghie\userextended\models\RegistrationForm',
- 'Profile' => 'cinghie\userextended\models\Profile',
- 'SettingsForm' => 'cinghie\userextended\models\SettingsForm',
- 'User' => 'cinghie\userextended\models\User',
- ],
- ],
- // Yii2 User Extended
- 'userextended' => [
- 'class' => 'cinghie\userextended\Module',
- 'avatarPath' => '@webroot/img/users/', // Path to your avatar files
- 'avatarURL' => '@web/img/users/', // Url to your avatar files
- 'defaultRole' => '',
- 'avatar' => true,
- 'bio' => false,
- 'captcha' => true,
- 'birthday' => true,
- 'firstname' => true,
- 'gravatarEmail' => false,
- 'lastname' => true,
- 'location' => false,
- 'onlyEmail' => false,
- 'publicEmail' => false,
- 'signature' => true,
- 'templateRegister' => '_two_column',
- 'terms' => true,
- 'website' => false,
- 'showTitles' => true, // Set false in adminLTE
- ],
- ],
- 'params' => $params,
- ];
- if (YII_ENV_DEV) {
- // configuration adjustments for 'dev' environment
- $config['bootstrap'][] = 'debug';
- $config['modules']['debug'] = [
- 'class' => 'yii\debug\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['127.0.0.1', '::1', '192.168.43.122'],
- ];
- $config['bootstrap'][] = 'gii';
- $config['modules']['gii'] = [
- 'class' => 'yii\gii\Module',
- // uncomment the following to add your IP if you are not connecting from localhost.
- 'allowedIPs' => ['127.0.0.1', '::1', '192.168.43.122'],
- ];
- }
- return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement