Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. <?php
  2.  
  3. $url = parse_url(getenv("CLEARDB_DATABASE_URL"));
  4. $host = $url["host"];
  5. $username = $url["user"];
  6. $password = $url["pass"];
  7. $database = substr($url["path"], 1);
  8.  
  9. return [
  10.  
  11. /*
  12. |--------------------------------------------------------------------------
  13. | PDO Fetch Style
  14. |--------------------------------------------------------------------------
  15. |
  16. | By default, database results will be returned as instances of the PHP
  17. | stdClass object; however, you may desire to retrieve records in an
  18. | array format for simplicity. Here you can tweak the fetch style.
  19. |
  20. */
  21.  
  22. 'fetch' => PDO::FETCH_OBJ,
  23.  
  24. /*
  25. |--------------------------------------------------------------------------
  26. | Default Database Connection Name
  27. |--------------------------------------------------------------------------
  28. |
  29. | Here you may specify which of the database connections below you wish
  30. | to use as your default connection for all database work. Of course
  31. | you may use many connections at once using the Database library.
  32. |
  33. */
  34.  
  35. 'default' => env('DB_CONNECTION', 'mysql'),
  36.  
  37. /*
  38. |--------------------------------------------------------------------------
  39. | Database Connections
  40. |--------------------------------------------------------------------------
  41. |
  42. | Here are each of the database connections setup for your application.
  43. | Of course, examples of configuring each database platform that is
  44. | supported by Laravel is shown below to make development simple.
  45. |
  46. |
  47. | All database work in Laravel is done through the PHP PDO facilities
  48. | so make sure you have the driver for your particular database of
  49. | choice installed on your machine before you begin development.
  50. |
  51. */
  52.  
  53. 'connections' => [
  54.  
  55. 'sqlite' => [
  56. 'driver' => 'sqlite',
  57. 'database' => env('DB_DATABASE', database_path('database.sqlite')),
  58. 'prefix' => '',
  59. ],
  60.  
  61. 'mysql' => [
  62. 'driver' => 'mysql',
  63. 'host' => $host,
  64. 'database' => $database,
  65. 'username' => $username,
  66. 'password' => $password,
  67. 'charset' => 'utf8',
  68. 'collation' => 'utf8_unicode_ci',
  69. 'prefix' => '',
  70. 'strict' => true,
  71. 'engine' => null,
  72. //'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock', // Uncomment if you are using MAMP
  73. ],
  74.  
  75. 'pgsql' => [
  76. 'driver' => 'pgsql',
  77. 'host' => env('DB_HOST', ''),
  78. 'port' => env('DB_PORT', ''),
  79. 'database' => env('DB_DATABASE', ''),
  80. 'username' => env('DB_USERNAME', ''),
  81. 'password' => env('DB_PASSWORD', ''),
  82. 'charset' => 'utf8',
  83. 'prefix' => '',
  84. 'schema' => 'public',
  85. 'sslmode' => 'prefer',
  86. ],
  87.  
  88. ],
  89.  
  90. /*
  91. |--------------------------------------------------------------------------
  92. | Migration Repository Table
  93. |--------------------------------------------------------------------------
  94. |
  95. | This table keeps track of all the migrations that have already run for
  96. | your application. Using this information, we can determine which of
  97. | the migrations on disk haven't actually been run in the database.
  98. |
  99. */
  100.  
  101. 'migrations' => 'migrations',
  102.  
  103. /*
  104. |--------------------------------------------------------------------------
  105. | Redis Databases
  106. |--------------------------------------------------------------------------
  107. |
  108. | Redis is an open source, fast, and advanced key-value store that also
  109. | provides a richer set of commands than a typical key-value systems
  110. | such as APC or Memcached. Laravel makes it easy to dig right in.
  111. |
  112. */
  113.  
  114. 'redis' => [
  115.  
  116. 'cluster' => false,
  117.  
  118. 'default' => [
  119. 'host' => env('REDIS_HOST', 'localhost'),
  120. 'password' => env('REDIS_PASSWORD', null),
  121. 'port' => env('REDIS_PORT', 6379),
  122. 'database' => 0,
  123. ],
  124.  
  125. ],
  126.  
  127. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement