process.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * This file is part of webman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. global $argv;
  15. return [
  16. // File update detection and automatic reload
  17. 'monitor' => [
  18. 'handler' => process\Monitor::class,
  19. 'reloadable' => false,
  20. 'constructor' => [
  21. // Monitor these directories
  22. 'monitorDir' => array_merge([
  23. app_path(),
  24. config_path(),
  25. base_path() . '/process',
  26. base_path() . '/support',
  27. base_path() . '/resource',
  28. base_path() . '/route',
  29. ], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
  30. // Files with these suffixes will be monitored
  31. 'monitorExtensions' => [
  32. 'php', 'html', 'htm', 'env'
  33. ],
  34. 'options' => [
  35. 'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
  36. 'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
  37. ]
  38. ]
  39. ],
  40. 'task' => [
  41. 'handler' => process\Task::class
  42. ],
  43. ];