Skip to content

Commit

Permalink
Fixes for the mode-specific DB credentials handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tbar0970 committed Jul 14, 2017
1 parent e6a4780 commit a9a615b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/jethrodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ public static function init($mode = '')
$username = DB_USERNAME;
$password = DB_PASSWORD;
if ($mode) {
if (strlen($x = ifdef(str_replace('DB_', 'DB_' . $mode . '_USERNAME'))))
if (strlen($x = ifdef('DB_'.$mode.'_USERNAME'))) {
$username = $x;
if (strlen($y = ifdef(str_replace('DB_', 'DB_' . $mode . '_PASSWORD'))))
}
if (strlen($y = ifdef('DB_'.$mode.'_PASSWORD'))) {
$password = $y;
}
}
}
$port = ifdef('DB_PORT', '');
Expand Down

0 comments on commit a9a615b

Please sign in to comment.