Skip to content

Commit

Permalink
updated the get_module_db function
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Feb 16, 2021
1 parent 128efde commit b9b7d05
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ function get_module_db($module)
$GLOBALS['powerdns_dbh']->Type = 'mysqli';
}
return clone $GLOBALS['powerdns_dbh'];
} elseif ($module == 'zonemta') {
if (!isset($GLOBALS['zonemta_dbh'])) {
$GLOBALS['zonemta_dbh'] = new \MyDb\Mysqli\Db(ZONEMTA_MYSQL_DB, ZONEMTA_MYSQL_USERNAME, ZONEMTA_MYSQL_PASSWORD, ZONEMTA_MYSQL_HOST);
$GLOBALS['zonemta_dbh']->Type = 'mysqli';
}
return clone $GLOBALS['zonemta_dbh'];
} else {
if (isset($GLOBALS[$module.'_dbh'])) {
return clone $GLOBALS[$module.'_dbh'];
Expand Down

0 comments on commit b9b7d05

Please sign in to comment.