Advertisement
qwertyR13

Untitled

Dec 24th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.43 KB | None | 0 0
  1.  
  2. web.php
  3.  
  4. <?php
  5.  
  6. $params = require __DIR__ . '/params.php';
  7. $db = require __DIR__ . '/db.php';
  8.  
  9. $config = [
  10. 'id' => 'basic',
  11. 'basePath' => dirname(__DIR__),
  12. 'bootstrap' => ['log'],
  13. 'language' => 'en',
  14. 'sourceLanguage' => 'en_GB',
  15. 'aliases' => [
  16. '@bower' => '@vendor/bower-asset',
  17. '@npm' => '@vendor/npm-asset',
  18.  
  19. ],
  20. 'components' => [
  21. 'seo' => [
  22. 'class' => 'cinghie\seo\Seo'
  23. ],
  24. 'i18n' => [
  25. 'translations' => [
  26. 'traits' => [
  27. 'class' => 'yii\i18n\PhpMessageSource',
  28. 'basePath' => '@vendor/cinghie/yii2-traits/messages',
  29. ],
  30. ],
  31. ],
  32.  
  33.  
  34. 'view' => [
  35. 'theme' => [
  36. 'pathMap' => [
  37. '@dektrium/rbac/views/permission' => '@vendor/cinghie/yii2-user-extended/views/permission',
  38. '@dektrium/rbac/views/role' => '@vendor/cinghie/yii2-user-extended/views/role',
  39. '@dektrium/rbac/views/rule' => '@vendor/cinghie/yii2-user-extended/views/rule',
  40. '@dektrium/user/views/admin' => '@vendor/cinghie/yii2-user-extended/views/admin',
  41. '@dektrium/user/views/profile' => '@vendor/cinghie/yii2-user-extended/views/profile',
  42. '@dektrium/user/views/role' => '@vendor/cinghie/yii2-user-extended/views/role',
  43. '@dektrium/user/views/security' => '@vendor/cinghie/yii2-user-extended/views/adminlte/security',
  44. '@dektrium/user/views/settings' => '@vendor/cinghie/yii2-user-extended/views/settings',
  45. '@dektrium/rbac/views' => '@vendor/cinghie/yii2-user-extended/views',
  46. '@dektrium/user/views' => '@vendor/cinghie/yii2-user-extended/views',
  47.  
  48. ],
  49. ],
  50. ],
  51.  
  52. 'authClientCollection' => [
  53. 'class' => yii\authclient\Collection::className(),
  54. 'clients' => [
  55. 'facebook' => [
  56. 'class' => 'dektrium\user\clients\Facebook',
  57. 'clientId' => '348751238839346',
  58. 'clientSecret' => '8707a527f9e1c4ebf00ba0dc35252c25',
  59. ],
  60. 'twitter' => [
  61. 'class' => 'dektrium\user\clients\Twitter',
  62. 'consumerKey' => 'CONSUMER_KEY',
  63. 'consumerSecret' => 'CONSUMER_SECRET',
  64. ],
  65. 'github' => [
  66. 'class' => 'dektrium\user\clients\GitHub',
  67. 'clientId' => 'a85f204e7683f96b7d75',
  68. 'clientSecret' => '1bb63620191b46ada14e1c4a407ceaca203eae50',
  69. ],
  70.  
  71. 'vkontakte' => [
  72. 'class' => 'dektrium\user\clients\VKontakte',
  73. 'clientId' => 'CLIENT_ID',
  74. 'clientSecret' => 'CLIENT_SECRET',
  75. ],
  76.  
  77. 'google' => [
  78. 'class' => 'dektrium\user\clients\Google',
  79. 'clientId' => 'CLIENT_ID',
  80. 'clientSecret' => 'CLIENT_SECRET',
  81.  
  82.  
  83.  
  84. ],
  85.  
  86. ],
  87.  
  88. ],
  89.  
  90. 'request' => [
  91. // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  92. 'cookieValidationKey' => 'Q0fRZJlh3uKlhXhPvxUFrHV_ZPvDlm4n',
  93. ],
  94. 'cache' => [
  95. 'class' => 'yii\caching\FileCache',
  96. ],
  97. //
  98. 'errorHandler' => [
  99. 'errorAction' => 'site/error',
  100. ],
  101.  
  102. 'mailer' => [
  103. 'class' => 'yii\swiftmailer\Mailer',
  104.  
  105. 'useFileTransport' => false,
  106. 'transport' => [
  107. 'class' => 'Swift_SmtpTransport',
  108. 'host' => 'smtp.yandex.ru',
  109. 'username' => '',
  110. 'password' => '',
  111. 'port' => '587',
  112. 'encryption' => 'tls',
  113. ],
  114. ],
  115. 'log' => [
  116. 'traceLevel' => YII_DEBUG ? 3 : 0,
  117. 'targets' => [
  118. [
  119. 'class' => 'yii\log\FileTarget',
  120. 'levels' => ['error', 'warning'],
  121. ],
  122. ],
  123. ],
  124. 'db' => $db,
  125.  
  126. 'urlManager' => [
  127. //
  128. 'class' => 'codemix\localeurls\UrlManager',
  129. 'languages' => ['en', 'it', 'fr', 'de', 'es'],
  130. // 'class' => 'yii\web\UrlManager',
  131. // Disable index.php .
  132. 'showScriptName' => false,
  133. // Disable r= routes
  134. 'enablePrettyUrl' => true,
  135. 'rules' => [
  136. '<id:\d+>/<alias:[A-Za-z0-9 -_.]+>' => 'articles/categories/view',
  137. '<cat>/<id:\d+>/<alias:[A-Za-z0-9 -_.]+>' => 'articles/items/view',
  138.  
  139. '<controller:\w+>/<id:\d+>'=>'<controller>/view',
  140. '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
  141. '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
  142.  
  143.  
  144.  
  145. ],
  146. ],
  147. ],
  148.  
  149. 'modules' => [
  150.  
  151. // Module Articles
  152. 'articles' => [
  153. 'class' => 'cinghie\articles\Articles',
  154. 'userClass' => 'dektrium\user\models\User',
  155.  
  156. // Select Languages allowed
  157. 'languages' => [
  158. "it-IT" => "it-IT",
  159. "en-GB" => "en-GB"
  160. ],
  161.  
  162.  
  163. // Select Date Format
  164. 'dateFormat' => 'd F Y',
  165.  
  166. // Select Editor: no-editor, ckeditor, imperavi, markdown, tinymce
  167. 'editor' => 'ckeditor',
  168.  
  169. // Select Path To Upload Category Image
  170. 'categoryImagePath' => '@webroot/img/articles/categories/',
  171. // Select URL To Upload Category Image
  172. 'categoryImageURL' => '@web/img/articles/categories/',
  173. // Select Path To Upload Category Thumb
  174. 'categoryThumbPath' => '@webroot/img/articles/categories/thumb/',
  175. // Select URL To Upload Category Image
  176. 'categoryThumbURL' => '@web/img/articles/categories/thumb/',
  177.  
  178. // Select Path To Upload Item Image
  179. 'itemImagePath' => '@webroot/img/articles/items/',
  180. // Select URL To Upload Item Image
  181. 'itemImageURL' => '@web/img/articles/items/',
  182. // Select Path To Upload Item Thumb
  183. 'itemThumbPath' => '@webroot/img/articles/items/thumb/',
  184. // Select URL To Upload Item Thumb
  185. 'itemThumbURL' => '@web/img/articles/items/thumb/',
  186.  
  187. // Select Path To Upload Attachments
  188. 'attachPath' => '@webroot/attachments/',
  189. // Select URL To Upload Attachment
  190. 'attachURL' => '@web/img/articles/items/',
  191. // Select Image Types allowed
  192. 'attachType' => ['jpg','jpeg','gif','png','csv','pdf','txt','doc','docs'],
  193.  
  194. // Select Image Name: categoryname, original, casual
  195. 'imageNameType' => 'categoryname',
  196. // Select Image Types allowed
  197. 'imageType' => ['png','jpg','jpeg'],
  198. // Thumbnails Options
  199. 'thumbOptions' => [
  200. 'small' => ['quality' => 100, 'width' => 150, 'height' => 100],
  201. 'medium' => ['quality' => 100, 'width' => 200, 'height' => 150],
  202. 'large' => ['quality' => 100, 'width' => 300, 'height' => 250],
  203. 'extra' => ['quality' => 100, 'width' => 400, 'height' => 350],
  204. ],
  205.  
  206.  
  207. // Show Titles in the views
  208. 'showTitles' => true,
  209.  
  210. ],
  211.  
  212. // Module Kartik-v Grid
  213. 'gridview' => [
  214. 'class' => '\kartik\grid\Module',
  215. ],
  216.  
  217. //depends extensions
  218. 'markdown' => [
  219. 'class' => 'kartik\markdown\Module',
  220. ],
  221.  
  222.  
  223.  
  224.  
  225. // Yii2 RBAC
  226. 'rbac' => [
  227. 'class' => 'dektrium\rbac\RbacWebModule'
  228. ],
  229. // Yii2 User
  230. 'user' => [
  231. 'class' => 'dektrium\user\Module',
  232. 'adminPermission' => 'role, permission',
  233. 'admins'=>['admin'],
  234. 'enableUnconfirmedLogin' => false,//boolean
  235. 'confirmWithin' => 21600,//integer
  236. 'cost' => 12, //integer
  237.  
  238. // ],
  239. 'controllerMap' => [
  240. 'admin' => 'cinghie\userextended\controllers\AdminController',
  241. 'settings' => 'cinghie\userextended\controllers\SettingsController'
  242. ],
  243. // Yii2 User Models Overrides
  244. 'modelMap' => [
  245. 'RegistrationForm' => 'cinghie\userextended\models\RegistrationForm',
  246. 'Profile' => 'cinghie\userextended\models\Profile',
  247. 'SettingsForm' => 'cinghie\userextended\models\SettingsForm',
  248. 'User' => 'cinghie\userextended\models\User',
  249. ],
  250. ],
  251. // Yii2 User Extended
  252. 'userextended' => [
  253. 'class' => 'cinghie\userextended\Module',
  254. 'avatarPath' => '@webroot/img/users/', // Path to your avatar files
  255. 'avatarURL' => '@web/img/users/', // Url to your avatar files
  256. 'defaultRole' => '',
  257. 'avatar' => true,
  258. 'bio' => false,
  259. 'captcha' => true,
  260. 'birthday' => true,
  261. 'firstname' => true,
  262. 'gravatarEmail' => false,
  263. 'lastname' => true,
  264. 'location' => false,
  265. 'onlyEmail' => false,
  266. 'publicEmail' => false,
  267. 'signature' => true,
  268. 'templateRegister' => '_two_column',
  269. 'terms' => true,
  270. 'website' => false,
  271. 'showTitles' => true, // Set false in adminLTE
  272. ],
  273. ],
  274.  
  275. 'params' => $params,
  276. ];
  277.  
  278. if (YII_ENV_DEV) {
  279. // configuration adjustments for 'dev' environment
  280. $config['bootstrap'][] = 'debug';
  281. $config['modules']['debug'] = [
  282. 'class' => 'yii\debug\Module',
  283. // uncomment the following to add your IP if you are not connecting from localhost.
  284. 'allowedIPs' => ['127.0.0.1', '::1', '192.168.43.122'],
  285. ];
  286.  
  287. $config['bootstrap'][] = 'gii';
  288. $config['modules']['gii'] = [
  289. 'class' => 'yii\gii\Module',
  290. // uncomment the following to add your IP if you are not connecting from localhost.
  291. 'allowedIPs' => ['127.0.0.1', '::1', '192.168.43.122'],
  292. ];
  293. }
  294.  
  295. return $config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement