process.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. base_path() . '/.env',
  30. ], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
  31. // Files with these suffixes will be monitored
  32. 'monitorExtensions' => [
  33. 'php', 'html', 'htm', 'env'
  34. ],
  35. 'options' => [
  36. 'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
  37. 'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
  38. ]
  39. ]
  40. ]
  41. ];