fecshop_local.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. // 本文件在app/web/index.php 处引入。
  3. // fecshop的核心模块
  4. $modules = [];
  5. foreach (glob(__DIR__.'/fecshop_local_modules/*.php') as $filename) {
  6. $modules = array_merge($modules, require($filename));
  7. }
  8. // services
  9. $services = [];
  10. foreach (glob(__DIR__.'/fecshop_local_services/*.php') as $filename) {
  11. $services = array_merge($services, require($filename));
  12. }
  13. // 组件
  14. $components = [
  15. 'i18n' => [
  16. 'translations' => [
  17. 'appserver' => [
  18. 'basePaths' => [
  19. '@appserver/languages',
  20. ],
  21. // base language code
  22. 'sourceLanguage' => 'en_US',
  23. /**
  24. * @var bool whether to force message translation when the source and target languages are the same.
  25. * Defaults to false, meaning translation is only performed when source and target languages are different.
  26. * see: @yii/i18n/MessageSource.php @property $forceTranslation
  27. */
  28. 'forceTranslation' => true,
  29. ],
  30. ],
  31. ],
  32. ];
  33. $params = [
  34. 'rateLimit' => [
  35. 'enable'=> false, // 是否开启?默认不开启速度控制。
  36. 'limit' => [120, 60], // 速度控制[120,60] 代表 60秒内最大访问120次,
  37. ],
  38. ];
  39. /**
  40. * Yii框架的class rewrite重写,这个一般不用,您可以通过这个重写基本上任何的class,但是这种方式是替换,重写的class无法继承原来的class,因此是替换的方式重写
  41. * Yii framework class rewrite: 文档:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#7yii2classclassmapfecmall
  42. */
  43. $yiiClassMap = [
  44. // 下面是一个重写的格式例子
  45. // 'fecshop\app\apphtml5\helper\test\My' => '@apphtml5/helper/My.php'
  46. ];
  47. /**
  48. * Fecmall model 和 block 重写,可以在RewriteMap中配置
  49. * 文档地址:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#8rewritemapblock-model
  50. */
  51. $fecRewriteMap = [
  52. // 下面是一个重写的格式例子
  53. // '\fecshop\app\appfront\modules\Cms\block\home\Index' => '\fectfurnilife\appfront\modules\Cms\block\home\Index',
  54. ];
  55. return [
  56. 'modules' => $modules,
  57. 'services' => $services,
  58. 'components' => $components,
  59. 'params' => $params,
  60. 'yiiClassMap' => $yiiClassMap,
  61. 'fecRewriteMap' => $fecRewriteMap,
  62. ];