Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
added heroku cleardb support
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlu committed Apr 5, 2012
1 parent f806cd4 commit 9de5363
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

if (empty($db['default']['hostname']) && isset($_SERVER['CLEARDB_DATABASE_URL']))
{
$cleardb = preg_split('/[\/:@]+/', $_SERVER['CLEARDB_DATABASE_URL']);
$db['default']['hostname'] = $cleardb[3];
$db['default']['username'] = $cleardb[1];
$db['default']['password'] = $cleardb[2];
$db['default']['database'] = $cleardb[4];
}

/* End of file database.php */
/* Location: ./application/config/database.php */
/* Location: ./application/config/database.php */

0 comments on commit 9de5363

Please sign in to comment.