diff options
author | Michael Lüpkes <michael@luepkes.net> | 2015-01-13 11:42:49 +0100 |
---|---|---|
committer | Michael Lüpkes <michael@luepkes.net> | 2015-01-13 11:42:49 +0100 |
commit | 34bbdaeac8c407a97a611cb858617eff3483dbb3 (patch) | |
tree | c6b76c98f667236e8a23b009c6d4980a58707e22 /app/common.php | |
parent | 81f3131bbc4eaabf8f7e2d8825e0ba45a5e1b507 (diff) | |
parent | 46fd893bd6728031d5f4118f952bf6cce5017965 (diff) |
Merge remote-tracking branch 'upstream/master' into fguillot/kanboard
Diffstat (limited to 'app/common.php')
-rw-r--r-- | app/common.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/common.php b/app/common.php index bd336d92..a434a73f 100644 --- a/app/common.php +++ b/app/common.php @@ -2,6 +2,18 @@ require 'vendor/autoload.php'; +// Automatically parse environment configuration (Heroku) +if (getenv('DATABASE_URL')) { + + $dbopts = parse_url(getenv('DATABASE_URL')); + + define('DB_DRIVER', $dbopts['scheme']); + define('DB_USERNAME', $dbopts["user"]); + define('DB_PASSWORD', $dbopts["pass"]); + define('DB_HOSTNAME', $dbopts["host"]); + define('DB_NAME', ltrim($dbopts["path"],'/')); +} + // Include custom config file if (file_exists('config.php')) { require 'config.php'; |