You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.4 KiB

5 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://doc.hyperf.io
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. return [
  12. 'default' => [
  13. 'driver' => env('DB_DRIVER', 'mysql'),
  14. 'host' => env('DB_HOST', 'localhost'),
  15. 'port' => env('DB_PORT', 3306),
  16. 'database' => env('DB_DATABASE', 'hyperf'),
  17. 'username' => env('DB_USERNAME', 'root'),
  18. 'password' => env('DB_PASSWORD', ''),
  19. 'charset' => env('DB_CHARSET', 'utf8'),
  20. 'collation' => env('DB_COLLATION', 'utf8_unicode_ci'),
  21. 'prefix' => env('DB_PREFIX', ''),
  22. 'pool' => [
  23. 'min_connections' => 1,
  24. 'max_connections' => 10,
  25. 'connect_timeout' => 10.0,
  26. 'wait_timeout' => 3.0,
  27. 'heartbeat' => -1,
  28. 'max_idle_time' => (float) env('DB_MAX_IDLE_TIME', 60),
  29. ],
  30. 'cache' => [
  31. 'handler' => Hyperf\ModelCache\Handler\RedisHandler::class,
  32. 'cache_key' => 'mc:%s:m:%s:%s:%s',
  33. 'prefix' => 'default',
  34. 'ttl' => 3600 * 24,
  35. 'empty_model_ttl' => 600,
  36. 'load_script' => true,
  37. ],
  38. 'commands' => [
  39. 'gen:model' => [
  40. 'path' => 'app/Model',
  41. 'force_casts' => true,
  42. 'inheritance' => 'Model',
  43. ],
  44. ],
  45. ],
  46. ];