fecshop_third.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  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 = FEC_APP ? FEC_APP : '';
  14. $app_arr = ['common'];
  15. $third_config_file = glob(__DIR__.'/fecshop_third_extensions/*.php');
  16. if (is_array($third_config_file) && !empty($third_config_file)) {
  17. sort($third_config_file);
  18. foreach ($third_config_file as $filename) {
  19. $c = require($filename);
  20. $extension_enable = isset($c['enable']) ? $c['enable'] : false;
  21. if ($extension_enable) {
  22. foreach ($app_arr as $current_app_name) {
  23. $curr_config = isset($c['app'][$current_app_name]) ? $c['app'][$current_app_name] : false;
  24. $app_enable = isset($curr_config['enable']) ? $curr_config['enable'] : false;
  25. $app_config = isset($curr_config['config']) ? $curr_config['config'] : false;
  26. if ($app_enable && is_array($app_config) && !empty($app_config)) {
  27. $third_config = yii\helpers\ArrayHelper::merge($third_config, $app_config);
  28. }
  29. }
  30. }
  31. }
  32. }
  33. return $third_config;