server.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. return [
  3. /*
  4. * mode
  5. * SWOOLE_BASE ,
  6. * SWOOLE_PROCESS
  7. */
  8. 'mode' => SWOOLE_BASE ,
  9. 'host' => '0.0.0.0',
  10. 'port' => 9000 ,
  11. 'sockType' => SWOOLE_SOCK_TCP ,
  12. 'additional' => [
  13. 'worker_num' => env('APP_WORKER_COUNT' , cpuCount() * 2) ,
  14. /*
  15. * log level
  16. * SWOOLE_LOG_DEBUG (default)
  17. * SWOOLE_LOG_TRACE
  18. * SWOOLE_LOG_INFO
  19. * SWOOLE_LOG_NOTICE
  20. * SWOOLE_LOG_WARNING
  21. * SWOOLE_LOG_ERROR
  22. */
  23. 'log_level' => SWOOLE_LOG_DEBUG ,
  24. 'log_file' => storagePath('logs/fomo.log') ,
  25. /*
  26. This key causes Fomo to receive a complete HTTP data packet and prevents it from receiving incomplete HTTP packets.
  27. */
  28. 'open_http_protocol' => true,
  29. ],
  30. 'ssl' => [
  31. 'ssl_cert_file' => null ,
  32. 'ssl_key_file' => null ,
  33. ] ,
  34. /*
  35. * The following services are created for better performance in the program, only one object is created from them and they can be used throughout the program
  36. */
  37. 'services' => [
  38. Fomo\Services\Cache::class ,
  39. Fomo\Services\Database::class ,
  40. Fomo\Services\Language::class ,
  41. Fomo\Services\Response::class ,
  42. Fomo\Services\Validation::class ,
  43. ] ,
  44. /*
  45. * Files and folders that must be changed in real time
  46. */
  47. 'watcher' => [
  48. 'app',
  49. 'config',
  50. 'database',
  51. 'language',
  52. 'routes',
  53. 'composer.lock',
  54. '.env',
  55. ] ,
  56. /*
  57. * Each of the following causes changes to the performance of the desired class. (so be careful in using them)
  58. */
  59. 'advanceMode' => [
  60. /*
  61. * advanced mode in Fomo\Request\Request class
  62. *
  63. * By activating the advanced mode in this class, you can access the data you want in an advanced way
  64. * For example, consider that the user has sent you a array of the information of several customers.
  65. * If the advanced mode is not active, you can only access an array of all customer information
  66. *
  67. * For example, the:
  68. * $request->get('customers')
  69. *
  70. * But if the advanced mode is active, you can access any data you need from customers
  71. * For example, the:
  72. * $request->get('customers.*.name')
  73. */
  74. 'request' => DISABLE
  75. ]
  76. ];