command.php 943 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: Dean <zxxjjforever@163.com>
  10. // +----------------------------------------------------------------------
  11. $apps = cmf_scan_dir(APP_PATH . '*', GLOB_ONLYDIR);
  12. $returnCommands = [];
  13. foreach ($apps as $app) {
  14. $commandFile = APP_PATH . $app . '/command.php';
  15. if (file_exists($commandFile)) {
  16. $commands = include $commandFile;
  17. $returnCommands = array_merge($returnCommands, $commands);
  18. }
  19. }
  20. return $returnCommands;