2015-02-05 21:39:52 -06:00
|
|
|
<?php
|
2016-10-04 23:52:15 -05:00
|
|
|
/**
|
|
|
|
* database.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
|
|
|
*/
|
2016-05-20 01:57:45 -05:00
|
|
|
|
2017-04-26 19:39:48 -05:00
|
|
|
// for heroku:
|
|
|
|
$databaseUrl = getenv('DATABASE_URL');
|
|
|
|
$host = '';
|
|
|
|
$username = '';
|
|
|
|
$password = '';
|
|
|
|
$database = '';
|
|
|
|
|
|
|
|
if (!($databaseUrl === false)) {
|
|
|
|
$options = parse_url($databaseUrl);
|
|
|
|
$host = $options['host'];
|
|
|
|
$username = $options['user'];
|
|
|
|
$password = $options['pass'];
|
|
|
|
$database = substr($options['path'], 1);
|
|
|
|
}
|
|
|
|
|
2015-02-05 21:39:52 -06:00
|
|
|
return [
|
|
|
|
|
2016-11-19 08:55:49 -06:00
|
|
|
'fetch' => PDO::FETCH_OBJ,
|
2017-04-26 19:40:57 -05:00
|
|
|
'default' => env('DB_CONNECTION', 'pgsql'),
|
2015-02-07 03:32:15 -06:00
|
|
|
'connections' => [
|
|
|
|
'sqlite' => [
|
2016-11-19 08:55:49 -06:00
|
|
|
'driver' => 'sqlite',
|
|
|
|
'database' => env('DB_DATABASE', storage_path('database/database.sqlite')),
|
|
|
|
'prefix' => '',
|
2015-02-07 03:32:15 -06:00
|
|
|
],
|
|
|
|
|
2016-01-08 08:59:21 -06:00
|
|
|
'mysql' => [
|
2016-11-19 08:55:49 -06:00
|
|
|
'driver' => 'mysql',
|
|
|
|
'host' => env('DB_HOST', 'localhost'),
|
|
|
|
'port' => env('DB_PORT', '3306'),
|
|
|
|
'database' => env('DB_DATABASE', 'forge'),
|
|
|
|
'username' => env('DB_USERNAME', 'forge'),
|
|
|
|
'password' => env('DB_PASSWORD', ''),
|
|
|
|
'charset' => 'utf8',
|
2016-09-15 23:19:40 -05:00
|
|
|
'collation' => 'utf8_unicode_ci',
|
2016-11-19 08:55:49 -06:00
|
|
|
'prefix' => '',
|
|
|
|
'strict' => true,
|
|
|
|
'engine' => null,
|
2015-02-07 03:32:15 -06:00
|
|
|
],
|
|
|
|
|
2016-09-15 23:19:40 -05:00
|
|
|
'pgsql' => [
|
2016-11-19 08:55:49 -06:00
|
|
|
'driver' => 'pgsql',
|
2017-04-26 19:39:48 -05:00
|
|
|
'host' => env('DB_HOST', $host),
|
2016-11-19 08:55:49 -06:00
|
|
|
'port' => env('DB_PORT', '5432'),
|
2017-04-26 19:39:48 -05:00
|
|
|
'database' => env('DB_DATABASE', $database),
|
|
|
|
'username' => env('DB_USERNAME', $username),
|
|
|
|
'password' => env('DB_PASSWORD', $password),
|
2016-11-19 08:55:49 -06:00
|
|
|
'charset' => 'utf8',
|
|
|
|
'prefix' => '',
|
|
|
|
'schema' => 'public',
|
|
|
|
'sslmode' => 'prefer',
|
2015-02-07 03:32:15 -06:00
|
|
|
],
|
|
|
|
|
|
|
|
],
|
2016-11-19 08:55:49 -06:00
|
|
|
'migrations' => 'migrations',
|
|
|
|
'redis' => [
|
2015-02-07 03:32:15 -06:00
|
|
|
'cluster' => false,
|
|
|
|
'default' => [
|
2016-11-19 08:55:49 -06:00
|
|
|
'host' => env('REDIS_HOST', 'localhost'),
|
2016-01-08 08:59:21 -06:00
|
|
|
'password' => env('REDIS_PASSWORD', null),
|
2016-11-19 08:55:49 -06:00
|
|
|
'port' => env('REDIS_PORT', 6379),
|
2015-02-07 03:32:15 -06:00
|
|
|
'database' => 0,
|
|
|
|
],
|
|
|
|
],
|
2015-02-05 21:39:52 -06:00
|
|
|
];
|