You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-07 17:42:53 +03:00
explode if there is no db connection made
This commit is contained in:
@@ -1433,11 +1433,16 @@ EOF;
|
|||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
*
|
*
|
||||||
* @return \PDO|false
|
* @return \PDO
|
||||||
*/
|
*/
|
||||||
function db_connect() {
|
function db_connect() {
|
||||||
list($link, $_) = db_connect_with_errors();
|
list($link, $_) = db_connect_with_errors();
|
||||||
unset($_);
|
unset($_);
|
||||||
|
|
||||||
|
if(!$link instanceof PDO) {
|
||||||
|
throw new Exception("Database connection failed");
|
||||||
|
}
|
||||||
|
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user