main.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. return [
  3. /*
  4. all theses below configuration will be covered by [backend|frontend|api|console]/main-[local].php and backend admin user filled in, the priority is:
  5. 以下配置将会被[backend|frontend|api|console]/main-[local].php以及后台管理页面配置的覆盖。优先顺序如下:
  6. 1. backend admin user filled in at admin web page.
  7. 2. [backend|frontend|api|console]/main-local.php.
  8. 3. [backend|frontend|api|console]/main.php
  9. 4. main-local.php
  10. 5. main.php
  11. */
  12. 'name' => 'Feehi CMS',
  13. 'version' => '2.1.1',
  14. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  15. 'aliases' => [
  16. '@bower' => '@vendor/bower-asset',
  17. '@npm' => '@vendor/npm-asset',
  18. ],
  19. 'components' => array_merge([
  20. /**
  21. * dsn:
  22. * - mysql mysql:host=localhost;dbname=feehi
  23. * - sqlite sqlite:/feehi.db
  24. */
  25. 'db' => [//database config, will be covered by backend|frontend|api]/main-[local].php
  26. 'class' => yii\db\Connection::className(),
  27. 'dsn' => 'sqlite:/feehi.db',
  28. 'username' => '',
  29. 'password' => '',
  30. 'charset' => '',
  31. ],
  32. 'cdn' => [//support Qiniu(七牛) TencentCloud(腾讯云) Aliyun(阿里云) Netease(网易云) more detail for visit http://doc.feehi.com/cdn.html
  33. 'class' => feehi\cdn\DummyTarget::className(),//不使用cdn
  34. ],
  35. 'cache' => [//cache component more detail for visit http://doc.feehi.com/configs.html
  36. 'class' => yii\caching\FileCache::className(),//use file cache, also can replace with redis or other
  37. ],
  38. 'formatter' => [//global display format configuration
  39. 'dateFormat' => 'php:Y-m-d H:i',
  40. 'datetimeFormat' => 'php:Y-m-d H:i:s',
  41. 'decimalSeparator' => ',',
  42. 'thousandSeparator' => ' ',
  43. 'currencyCode' => 'CHY',
  44. 'nullDisplay' => '-',
  45. ],
  46. 'mailer' => [
  47. /* Attention(特别注意):
  48. email sender, will be covered by backend|frontend|api|console]/main-[local].php, and backend admin user filled in "/admin/index.php?setting/website". backend admin user filled in own most priority.
  49. 邮件发送者配置,将会被backend|frontend|api|console]/main-[local].php和后台管理页面"/admin/index.php?setting/website"填入的覆盖。管理页面填入的拥有最高的优先级。
  50. */
  51. 'class' => yii\swiftmailer\Mailer::className(),
  52. 'viewPath' => '@common/mail',
  53. /* Attention(特别注意):
  54. if useFileTransport was true, they will not send email, just write to directory runtime. they may cause takes up a lot of disk space.
  55. if was false, when you configured a none exists SMTP server ip or other error occurs, html page will be block until connect to SMTP timeout.
  56. 如果useFileTransport为true,并不会真发邮件,只会把邮件写入runtime目录,很有可能造成您的磁盘使用飙升。
  57. 如果为false,当您配置的STMP地址不存在或错误,页面会一直等到连接邮件服务器超时才会输出页面。
  58. */
  59. 'useFileTransport' => true,
  60. 'transport' => [
  61. 'class' => 'Swift_SmtpTransport',
  62. 'host' => 'smtp.feehi.com',
  63. 'username' => 'admin@feehi.com',
  64. 'password' => 'password',
  65. 'port' => '586',
  66. 'encryption' => 'tls',
  67. ],
  68. 'messageConfig' => [
  69. 'charset' => 'UTF-8',
  70. 'from' => ['admin@feehi.com' => 'Feehi CMS robot ']
  71. ],
  72. ],
  73. 'feehi' => [
  74. 'class' => common\components\Feehi::className(),
  75. ],
  76. 'authManager' => [
  77. 'class' => yii\rbac\DbManager::className(),
  78. ],
  79. 'assetManager' => [
  80. /*
  81. * if was true, will not copy js/css files to @web/assets @web/admin/assets. just create a symbolic link. NOT SUPPORT WINDOWS(windows cannot create symbolic link)
  82. * if was false, will copy js/css files to @web/assets @web/admin/assets.
  83. *
  84. * 如果为true,将不会拷贝js/css文件到@web/assets @web/admin/assets。而是生成一个软链接。切记不支持WINDOWS(windows不能创建软链接)
  85. * 如果为false,将会拷贝js/css文件到@web/assets @web/admin/assets
  86. */
  87. 'linkAssets' => false,
  88. /*
  89. * this is always used for config CDN for load js/css. these configs will replace [backend/frontend]/assets/XXXAsset.php public $css | public $js properties
  90. * 这个配置通常用于配置资源文件(js/css)走CDN. 这些配置将会替换掉[backend/frontend]/assets/XXXAsset.php public $css | public $js的属性值
  91. */
  92. 'bundles' => [
  93. yii\widgets\ActiveFormAsset::className() => [
  94. 'js' => [
  95. 'a' => 'yii.activeForm.js'
  96. ],
  97. ],
  98. yii\bootstrap\BootstrapAsset::className() => [
  99. 'css' => [],
  100. 'sourcePath' => null,
  101. ],
  102. yii\captcha\CaptchaAsset::className() => [
  103. 'js' => [
  104. 'a' => 'yii.captcha.js'
  105. ],
  106. ],
  107. yii\grid\GridViewAsset::className() => [
  108. 'js' => [
  109. 'a' => 'yii.gridView.js'
  110. ],
  111. ],
  112. yii\web\JqueryAsset::className() => [
  113. 'js' => [
  114. 'a' => 'jquery.js'
  115. ],
  116. ],
  117. yii\widgets\PjaxAsset::className() => [
  118. 'js' => [
  119. 'a' => 'jquery.pjax.js'
  120. ],
  121. ],
  122. yii\web\YiiAsset::className() => [
  123. 'js' => [
  124. 'a' => 'yii.js'
  125. ],
  126. ],
  127. yii\validators\ValidationAsset::className() => [
  128. 'js' => [
  129. 'a' => 'yii.validation.js'
  130. ],
  131. ],
  132. ],
  133. ],
  134. ], require "services.php")
  135. ];