fecshop_third.php 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * FecShop file.
  4. * @link http://www.fecshop.com/
  5. * @copyright Copyright (c) 2016 FecShop Software LLC
  6. * @license http://www.fecshop.com/license/
  7. */
  8. /**
  9. * 本文件在app/web/index.php 处引入。
  10. * 本配置文件为第三方插件库包的配置文件
  11. */
  12. $third_config = [];
  13. $current_app_name = 'appapi';
  14. $third_config_file = glob(__DIR__.'/../../common/config/fecshop_third_extensions/*.php');
  15. if (is_array($third_config_file) && !empty($third_config_file)) {
  16. sort($third_config_file);
  17. foreach ($third_config_file as $filename) {
  18. $c = require($filename);
  19. $extension_enable = isset($c['enable']) ? $c['enable'] : false;
  20. if ($extension_enable) {
  21. $curr_config = isset($c['app'][$current_app_name]) ? $c['app'][$current_app_name] : false;
  22. $app_enable = isset($curr_config['enable']) ? $curr_config['enable'] : false;
  23. $app_config = isset($curr_config['config']) ? $curr_config['config'] : false;
  24. if ($app_enable && is_array($app_config) && !empty($app_config)) {
  25. $third_config = array_merge($third_config, $app_config);
  26. }
  27. }
  28. }
  29. }
  30. return $third_config;