database.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | PDO Fetch Style
  6. |--------------------------------------------------------------------------
  7. |
  8. | By default, database results will be returned as instances of the PHP
  9. | stdClass object; however, you may desire to retrieve records in an
  10. | array format for simplicity. Here you can tweak the fetch style.
  11. |
  12. */
  13. 'fetch' => PDO::FETCH_CLASS,
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Default Database Connection Name
  17. |--------------------------------------------------------------------------
  18. |
  19. | Here you may specify which of the database connections below you wish
  20. | to use as your default connection for all database work. Of course
  21. | you may use many connections at once using the Database library.
  22. |
  23. */
  24. 'default' => env('DB_CONNECTION', 'mysql'),
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Database Connections
  28. |--------------------------------------------------------------------------
  29. |
  30. | Here are each of the database connections setup for your application.
  31. | Of course, examples of configuring each database platform that is
  32. | supported by Laravel is shown below to make development simple.
  33. |
  34. |
  35. | All database work in Laravel is done through the PHP PDO facilities
  36. | so make sure you have the driver for your particular database of
  37. | choice installed on your machine before you begin development.
  38. |
  39. */
  40. 'connections' => [
  41. 'sqlite' => [
  42. 'driver' => 'sqlite',
  43. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  44. 'prefix' => '',
  45. ],
  46. 'mysql' => [
  47. 'driver' => 'mysql',
  48. //'host' => env('DB_HOST', 'localhost'),
  49. 'read' => [
  50. 'host' => env('DB_READ_HOST', 'localhost'),
  51. ],
  52. 'write' => [
  53. 'host' => env('DB_WRITE_HOST', 'localhost'),
  54. ],
  55. 'port' => env('DB_PORT', '3306'),
  56. 'database' => env('DB_DATABASE', 'forge'),
  57. 'username' => env('DB_USERNAME', 'forge'),
  58. 'password' => env('DB_PASSWORD', ''),
  59. 'charset' => 'utf8',
  60. 'collation' => 'utf8_unicode_ci',
  61. 'prefix' => '',
  62. 'strict' => false,
  63. 'engine' => null,
  64. ],
  65. 'chapter_order_mysql' => [
  66. 'driver' => 'mysql',
  67. 'host' => env('CHAPTER_DB_HOST', 'localhost'),
  68. 'port' => env('CHAPTER_DB_PORT', '3306'),
  69. 'database' => env('CHAPTER_DB_DATABASE', 'forge'),
  70. 'username' => env('CHAPTER_DB_USERNAME', 'forge'),
  71. 'password' => env('CHAPTER_DB_PASSWORD', ''),
  72. 'charset' => 'utf8',
  73. 'collation' => 'utf8_unicode_ci',
  74. 'prefix' => '',
  75. 'strict' => false,
  76. 'engine' => null,
  77. ],
  78. 'qapp_order_mysql' => [
  79. 'driver' => 'mysql',
  80. 'host' => env('QAPP_DB_HOST', 'localhost'),
  81. 'port' => env('QAPP_DB_PORT', '3306'),
  82. 'database' => env('QAPP_DB_DATABASE', 'forge'),
  83. 'username' => env('QAPP_DB_USERNAME', 'forge'),
  84. 'password' => env('QAPP_DB_PASSWORD', ''),
  85. 'charset' => 'utf8',
  86. 'collation' => 'utf8_unicode_ci',
  87. 'prefix' => '',
  88. 'strict' => false,
  89. 'engine' => null,
  90. ],
  91. 'qapp_log_mysql' => [
  92. 'driver' => 'mysql',
  93. 'host' => env('QAPP_LOG_DB_HOST', 'localhost'),
  94. 'port' => env('QAPP_LOG_DB_PORT', '3306'),
  95. 'database' => env('QAPP_LOG_DB_DATABASE', 'forge'),
  96. 'username' => env('QAPP_LOG_DB_USERNAME', 'forge'),
  97. 'password' => env('QAPP_LOG_DB_PASSWORD', ''),
  98. 'charset' => 'utf8',
  99. 'collation' => 'utf8_unicode_ci',
  100. 'prefix' => '',
  101. 'strict' => false,
  102. 'engine' => null,
  103. ],
  104. 'new_yunqi' => [
  105. 'driver' => 'mysql',
  106. 'host' => env('NEW_YUNQI_DB_HOST', 'localhost'),
  107. 'port' => env('NEW_YUNQI_DB_PORT', '3306'),
  108. 'database' => env('NEW_YUNQI_DB_DATABASE', 'forget'),
  109. 'username' => env('NEW_YUNQI_DB_USERNAME', 'forget'),
  110. 'password' => env('NEW_YUNQI_DB_PASSWORD', ''),
  111. 'charset' => 'utf8',
  112. 'collation' => 'utf8_unicode_ci',
  113. 'prefix' => '',
  114. 'strict' => false,
  115. 'engine' => null,
  116. ],
  117. 'pgsql' => [
  118. 'driver' => 'pgsql',
  119. 'host' => env('DB_HOST', 'localhost'),
  120. 'port' => env('DB_PORT', '5432'),
  121. 'database' => env('DB_DATABASE', 'forge'),
  122. 'username' => env('DB_USERNAME', 'forge'),
  123. 'password' => env('DB_PASSWORD', ''),
  124. 'charset' => 'utf8',
  125. 'prefix' => '',
  126. 'schema' => 'public',
  127. ],
  128. ],
  129. /*
  130. |--------------------------------------------------------------------------
  131. | Migration Repository Table
  132. |--------------------------------------------------------------------------
  133. |
  134. | This table keeps track of all the migrations that have already run for
  135. | your application. Using this information, we can determine which of
  136. | the migrations on disk haven't actually been run in the database.
  137. |
  138. */
  139. 'migrations' => 'migrations',
  140. /*
  141. |--------------------------------------------------------------------------
  142. | Redis Databases
  143. |--------------------------------------------------------------------------
  144. |
  145. | Redis is an open source, fast, and advanced key-value store that also
  146. | provides a richer set of commands than a typical key-value systems
  147. | such as APC or Memcached. Laravel makes it easy to dig right in.
  148. |
  149. */
  150. 'redis' => [
  151. 'cluster' => false,
  152. 'default' => [
  153. 'host' => env('REDIS_HOST', 'localhost'),
  154. 'password' => env('REDIS_PASSWORD', null),
  155. 'port' => env('REDIS_PORT', 6379),
  156. 'database' => 0,
  157. ],
  158. 'order' => [
  159. 'host' => env('REDIS_HOST_ORDER', 'localhost'),
  160. 'password' => env('REDIS_PASSWORD_ORDER', null),
  161. 'port' => env('REDIS_PORT_ORDER', 6379),
  162. 'database' => env('REDIS_DATABASE_ORDER', 0),
  163. ],
  164. 'chapter' => [
  165. 'host' => env('REDIS_HOST_CHAPTER', 'localhost'),
  166. 'password' => env('REDIS_PASSWORD_CHAPTER', null),
  167. 'port' => env('REDIS_PORT_CHAPTER', 6379),
  168. 'database' => env('REDIS_DATABASE_CHAPTER', 0),
  169. ],
  170. 'redis-queue' => [
  171. 'host' => env('REDIS_HOST', 'localhost'),
  172. 'password' => env('REDIS_PASSWORD', null),
  173. 'port' => env('REDIS_PORT', 6379),
  174. 'database' => 10
  175. ],
  176. 'redis_queue_new' => [//专门处理队列的服务器
  177. 'host' => env('REDIS_HOST_QUEUE', 'localhost'),
  178. 'password' => env('REDIS_PASSWORD_QUEUE', null),
  179. 'port' => env('REDIS_PORT_QUEUE', 6379),
  180. 'database' => 2,
  181. ],
  182. ],
  183. ];