暫無描述

database.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. return array(
  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' => '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' => array(
  41. 'mysql' => array(
  42. 'driver' => 'mysql',
  43. 'host' => $_ENV['MYSQL_HOST'] ?: 'localhost',
  44. 'database' => $_ENV['MYSQL_DATABASE'] ?: 'laravel',
  45. 'username' => $_ENV['MYSQL_USERNAME'] ?: 'root',
  46. 'password' => $_ENV['MYSQL_PASSWORD'] ?: '',
  47. 'charset' => 'utf8',
  48. 'collation' => 'utf8_unicode_ci',
  49. 'prefix' => '',
  50. 'engine' => 'InnoDB',
  51. ),
  52. ),
  53. /*
  54. |--------------------------------------------------------------------------
  55. | Migration Repository Table
  56. |--------------------------------------------------------------------------
  57. |
  58. | This table keeps track of all the migrations that have already run for
  59. | your application. Using this information, we can determine which of
  60. | the migrations on disk haven't actually been run in the database.
  61. |
  62. */
  63. 'migrations' => 'migrations',
  64. /*
  65. |--------------------------------------------------------------------------
  66. | Redis Databases
  67. |--------------------------------------------------------------------------
  68. |
  69. | Redis is an open source, fast, and advanced key-value store that also
  70. | provides a richer set of commands than a typical key-value systems
  71. | such as APC or Memcached. Laravel makes it easy to dig right in.
  72. |
  73. */
  74. 'redis' => array(
  75. 'cluster' => false,
  76. 'default' => array(
  77. 'host' => '127.0.0.1',
  78. 'port' => 6379,
  79. 'database' => 0,
  80. ),
  81. ),
  82. );