Skip to content

Instantly share code, notes, and snippets.

@yannski
Forked from paulobunga/database.php
Last active July 27, 2018 13:59
Show Gist options
  • Save yannski/1b71190bcb4f301cffbc69d2ff70d01b to your computer and use it in GitHub Desktop.
Save yannski/1b71190bcb4f301cffbc69d2ff70d01b to your computer and use it in GitHub Desktop.
//Add this to fetch the SCALINGO_MYSQL_URL
$url = parse_url(getenv("SCALINGO_MYSQL_URL"));
$db['default'] = array(
'dsn' => '',
'hostname' => $url["host"],
'username' => $url["user"],
'password' => $url["pass"],
'database' => substr($url["path"], 1),
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment