fecshop_third.php 1.5 KB

123456789101112131415161718192021222324252627282930313233
  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 = 'appadmin';
  14. if (is_array($fecmall_db_extensions_data) && !empty($fecmall_db_extensions_data)) {
  15. foreach ($fecmall_db_extensions_data as $one) {
  16. $configFile = Yii::getAlias($one['config_file_path']);
  17. if (!file_exists($configFile)) continue;
  18. $c = require($configFile);
  19. $curr_config = isset($c['app'][$current_app_name]) ? $c['app'][$current_app_name] : false;
  20. $app_enable = isset($curr_config['enable']) ? $curr_config['enable'] : false;
  21. $app_config = isset($curr_config['config']) ? $curr_config['config'] : false;
  22. if ($app_enable && is_array($app_config) && !empty($app_config)) {
  23. $third_config = yii\helpers\ArrayHelper::merge($third_config, $app_config);
  24. }
  25. }
  26. }
  27. // 引入theme,前面的优先级高,所以进行反转
  28. if (isset($third_config['services']['page']['childService']['theme']['thirdThemeDir']) && is_array($third_config['services']['page']['childService']['theme']['thirdThemeDir'])) {
  29. $third_config['services']['page']['childService']['theme']['thirdThemeDir'] = array_reverse($third_config['services']['page']['childService']['theme']['thirdThemeDir']);
  30. }
  31. return $third_config;