Console.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace core\dict;
  12. class Console extends BaseDict
  13. {
  14. /**
  15. * 加载事件
  16. * @param array $data
  17. * @return array|mixed
  18. */
  19. public function load(array $data)
  20. {
  21. $addons = $this->getAllLocalAddons();
  22. $console_files = [];
  23. foreach ($addons as $v) {
  24. $console_path = $this->getAddonAppPath($v) . "/config/console.php";
  25. if (is_file($console_path)) {
  26. $console_files[] = $console_path;
  27. }
  28. }
  29. $files_data = $this->loadFiles($console_files);
  30. $console = $data;
  31. foreach ($files_data as $file_data) {
  32. if(!empty($file_data))
  33. {
  34. $console = empty($console) ? $file_data : array_merge2($console, $file_data);
  35. }
  36. }
  37. return $console;
  38. }
  39. }