fecshop_local.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. // param
  16. $params = [
  17. 'rateLimit' => [
  18. 'enable'=> false, // 是否开启?默认不开启速度控制。
  19. 'limit' => [120, 60], // 速度控制[120,60] 代表 60秒内最大访问120次,
  20. ],
  21. /**
  22. * 该配置用来设置:允许那些账户在appapi入口进行登录获取token
  23. * 1.apiUserAllow数组的值为空:代表默认是所有的后台用户
  24. * 2.apiUserAllow数组中设置了用户名(数组可以设置多个),那么,只有包含在这个数组中的用户,才可以用于appapi用户登录获取access-token。其他的账户获取token就会失败
  25. * 3.默认该数组为空,允许所有的appadmin的后台用户进行登录获取access-token
  26. */
  27. 'apiUserAllow' => [
  28. // 'admin','terry'
  29. ],
  30. ];
  31. /**
  32. * Yii框架的class rewrite重写,这个一般不用,您可以通过这个重写基本上任何的class,但是这种方式是替换,重写的class无法继承原来的class,因此是替换的方式重写
  33. * Yii framework class rewrite: 文档:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#7yii2classclassmapfecmall
  34. */
  35. $yiiClassMap = [
  36. // 下面是一个重写的格式例子
  37. // 'fecshop\app\apphtml5\helper\test\My' => '@apphtml5/helper/My.php'
  38. ];
  39. /**
  40. * Fecmall model 和 block 重写,可以在RewriteMap中配置
  41. * 文档地址:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#8rewritemapblock-model
  42. */
  43. $fecRewriteMap = [
  44. // 下面是一个重写的格式例子
  45. // '\fecshop\app\appfront\modules\Cms\block\home\Index' => '\fectfurnilife\appfront\modules\Cms\block\home\Index',
  46. ];
  47. return [
  48. 'modules' => $modules,
  49. 'services' => $services,
  50. 'components' => $components,
  51. 'params' => $params,
  52. 'yiiClassMap' => $yiiClassMap,
  53. 'fecRewriteMap' => $fecRewriteMap,
  54. ];