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:
27
public/config.php
Normal file
27
public/config.php
Normal 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);
|
||||
?>
|
Reference in New Issue
Block a user