process.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. use support\Log;
  3. use support\Request;
  4. use app\process\Http;
  5. global $argv;
  6. return [
  7. 'wash' => [
  8. 'handler' => Http::class,
  9. 'listen' => 'http://0.0.0.0:8190',
  10. 'count' => cpu_count() * 4,
  11. 'user' => '',
  12. 'group' => '',
  13. 'reusePort' => false,
  14. 'eventLoop' => '',
  15. 'context' => [],
  16. 'constructor' => [
  17. 'requestClass' => Request::class,
  18. 'logger' => Log::channel('default'),
  19. 'appPath' => app_path(),
  20. 'publicPath' => public_path()
  21. ]
  22. ],
  23. // File update detection and automatic reload
  24. 'monitor' => [
  25. 'handler' => app\process\Monitor::class,
  26. 'reloadable' => false,
  27. 'constructor' => [
  28. // Monitor these directories
  29. 'monitorDir' => array_merge([
  30. app_path(),
  31. config_path(),
  32. base_path() . '/process',
  33. base_path() . '/support',
  34. base_path() . '/resource',
  35. base_path() . '/.env',
  36. ], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
  37. // Files with these suffixes will be monitored
  38. 'monitorExtensions' => [
  39. 'php', 'html', 'htm', 'env'
  40. ],
  41. 'options' => [
  42. 'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
  43. 'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
  44. ]
  45. ]
  46. ]
  47. ];