process.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. use app\process\Http;
  15. use support\Log;
  16. use support\Request;
  17. global $argv;
  18. return [
  19. 'webman' => [
  20. 'handler' => Http::class,
  21. 'listen' => 'http://0.0.0.0:8787',
  22. 'count' => cpu_count() * 4,
  23. 'user' => '',
  24. 'group' => '',
  25. 'reusePort' => false,
  26. 'eventLoop' => '',
  27. 'context' => [],
  28. 'constructor' => [
  29. 'requestClass' => Request::class,
  30. 'logger' => Log::channel('default'),
  31. 'appPath' => app_path(),
  32. 'publicPath' => public_path()
  33. ]
  34. ],
  35. // File update detection and automatic reload
  36. 'monitor' => [
  37. 'handler' => app\process\Monitor::class,
  38. 'reloadable' => false,
  39. 'constructor' => [
  40. // Monitor these directories
  41. 'monitorDir' => array_merge([
  42. app_path(),
  43. config_path(),
  44. base_path() . '/process',
  45. base_path() . '/support',
  46. base_path() . '/resource',
  47. base_path() . '/.env',
  48. ], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
  49. // Files with these suffixes will be monitored
  50. 'monitorExtensions' => [
  51. 'php', 'html', 'htm', 'env'
  52. ],
  53. 'options' => [
  54. 'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
  55. 'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
  56. ]
  57. ]
  58. ],
  59. 'create_tables' => [
  60. 'handler' => \app\process\CreateTables::class,
  61. ],
  62. 'base_total' => [
  63. 'handler' => \app\process\dataReport\BaseTotal::class,
  64. ],
  65. 'base_active_day' => [
  66. 'handler' => \app\process\dataReport\BasicActiveDay::class,
  67. ],
  68. 'game_reg_pay' => [
  69. 'handler' => \app\process\dataReport\GameRegPay::class,
  70. ],
  71. 'game_total' => [
  72. 'handler' => \app\process\dataReport\GameTotal::class,
  73. ],
  74. // gdt 获取广告消耗
  75. 'gdt_cost' => [
  76. 'handler' => \app\process\advertCost\GdtCostHour::class,
  77. ],
  78. // gdt 获取广告消耗
  79. 'tt_cost' => [
  80. 'handler' => \app\process\advertCost\TtCostHour::class,
  81. ],
  82. ];