1
mirror of https://github.com/jakejarvis/spoons.git synced 2025-10-22 20:34:29 -04:00

use environment variables for sensitive config info

This commit is contained in:
2017-07-16 13:19:00 -04:00
parent 24354e198b
commit 8af377fdb7
2 changed files with 5 additions and 6 deletions

27
public/config.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
/* site config */
$site_url = getenv('SITE_URL'); // ex: https://idspoons.herokuapp.com (no trailing slash)
$site_password = getenv('SITE_PASSWORD');
/* database config */
if(isset(getenv('JAWSDB_URL'))) {
$db_parts = parse_url(getenv('JAWSDB_URL'));
$db_host = $db_parts['host'];
$db_user = $db_parts['user'];
$db_pass = $db_parts['pass'];
$db_name = ltrim($db_parts['path'],'/');
$db_port = 3306;
} else {
$db_host = "localhost";
$db_port = 8889;
$db_user = "lol";
$db_pass = "yourpassword";
$db_name = "spoons";
}
$timezone_number = "-4:00";
$timezone_name = "America/New_York";
date_default_timezone_set($timezone_name);
?>