Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added heroku cleardb support

  • Loading branch information...
commit 9de5363f262e6b7bbae66907827a9ca0564fa590 1 parent f806cd4
@sjlu authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 application/config/database.php
View
10 application/config/database.php
@@ -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 */
Please sign in to comment.
Something went wrong with that request. Please try again.