main.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. return [
  3. 'vendorPath' => '@root/vendor',
  4. 'runtimePath' => '@app/runtime',
  5. 'timezone' => 'PRC',
  6. 'language' => 'zh-CN',
  7. 'bootstrap' => [
  8. 'log',
  9. 'common\\components\\LoadModule',
  10. 'common\\components\\LoadPlugin',
  11. ],
  12. 'components' => [
  13. //rbac授权组件
  14. 'authManager' => [
  15. 'class' => 'common\modules\rbac\components\DbManager',
  16. ],
  17. 'cache' => [
  18. 'class' => 'yii\caching\FileCache',
  19. 'cachePath' => '@root/cache',
  20. 'dirMode' => 0777 // 防止console生成的目录导致web账户没写权限
  21. ],
  22. 'formatter' => [
  23. 'dateFormat' => 'yyyy-MM-dd',
  24. 'datetimeFormat' => 'yyyy-MM-dd HH:mm',
  25. 'timeFormat' => 'HH:mm',
  26. 'decimalSeparator' => '.',
  27. 'thousandSeparator' => ' ',
  28. 'currencyCode' => 'CNY',
  29. ],
  30. 'log' => [
  31. 'targets' => [
  32. 'db'=>[
  33. 'class' => 'yii\log\DbTarget',
  34. 'levels' => ['warning', 'error'],
  35. 'except'=>['yii\web\HttpException:*', 'yii\i18n\I18N\*'],
  36. 'prefix'=>function () {
  37. $url = !Yii::$app->request->isConsoleRequest ? Yii::$app->request->getUrl() : null;
  38. return sprintf('[%s][%s]', Yii::$app->id, $url);
  39. },
  40. 'logVars'=>[],
  41. 'logTable'=>'{{%system_log}}'
  42. ],
  43. ]
  44. ],
  45. 'notify' => 'common\components\notify\Handler',
  46. 'moduleManager' => [
  47. 'class' => 'common\\components\\ModuleManager'
  48. ],
  49. 'pluginManager' => [
  50. 'class' => 'common\components\PluginManager',
  51. ],
  52. ],
  53. //rbac别名
  54. 'aliases' => [
  55. '@rbac' => '@common/modules/rbac',
  56. ],
  57. ];