mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Update config for Heroku [skip ci]
This commit is contained in:
parent
18a5bb682d
commit
dedf774bf2
@ -8,11 +8,8 @@ APP_URL=http://localhost
|
||||
TRUSTED_PROXIES=
|
||||
|
||||
DB_CONNECTION=pgsql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=homestead
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
# no DB info, is in database URL.
|
||||
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
|
2
app.json
2
app.json
@ -43,7 +43,7 @@
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"postdeploy": "php artisan migrate:refresh --seed"
|
||||
"postdeploy": "php artisan migrate:refresh --seed;php artisan firefly:instructions install"
|
||||
},
|
||||
"buildpacks": [
|
||||
{
|
||||
|
@ -22,6 +22,20 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
return [
|
||||
|
||||
'default' => env('DB_CONNECTION', 'mysql'),
|
||||
@ -47,11 +61,11 @@ return [
|
||||
],
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'host' => env('DB_HOST', $host),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'database' => env('DB_DATABASE', $database),
|
||||
'username' => env('DB_USERNAME', $username),
|
||||
'password' => env('DB_PASSWORD', $password),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
|
Loading…
Reference in New Issue
Block a user