fecshop_third.php 1.1 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. // read third config from $fecmall_db_extensions_data
  13. $third_config = [];
  14. $current_app_name = 'common';
  15. if (is_array($fecmall_db_extensions_data) && !empty($fecmall_db_extensions_data)) {
  16. foreach ($fecmall_db_extensions_data as $one) {
  17. $configFile = Yii::getAlias($one['config_file_path']);
  18. if (!file_exists($configFile)) {
  19. continue;
  20. }
  21. $c = require($configFile);
  22. $curr_config = isset($c['app'][$current_app_name]) ? $c['app'][$current_app_name] : false;
  23. $app_enable = isset($curr_config['enable']) ? $curr_config['enable'] : false;
  24. $app_config = isset($curr_config['config']) ? $curr_config['config'] : false;
  25. if ($app_enable && is_array($app_config) && !empty($app_config)) {
  26. $third_config = yii\helpers\ArrayHelper::merge($third_config, $app_config);
  27. }
  28. }
  29. }
  30. return $third_config;