route.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-present http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Released under the MIT License.
  8. // +----------------------------------------------------------------------
  9. // | Author: Dean <zxxjjforever@163.com>
  10. // +----------------------------------------------------------------------
  11. $apps = cmf_scan_dir(CMF_ROOT . 'api/*', GLOB_ONLYDIR);
  12. foreach ($apps as $app) {
  13. $routeFile = CMF_ROOT . 'api/' . $app . '/route.php';
  14. if (file_exists($routeFile)) {
  15. include_once $routeFile;
  16. }
  17. }
  18. $coreApps = cmf_scan_dir(CMF_ROOT . 'vendor/thinkcmf/cmf-api/src/*', GLOB_ONLYDIR);
  19. foreach ($coreApps as $app) {
  20. $routeFile = CMF_ROOT . 'vendor/thinkcmf/cmf-api/src/' . $app . '/route.php';
  21. if (file_exists($routeFile)) {
  22. include_once $routeFile;
  23. }
  24. }
  25. if (file_exists(CMF_DATA . "conf/route.php")) {
  26. $runtimeRoutes = include CMF_DATA . "conf/route.php";
  27. } else {
  28. $runtimeRoutes = [];
  29. }
  30. return $runtimeRoutes;