Ensure the check can be tested. re #127
This commit is contained in:
parent
cd626b25ef
commit
8a72e1a6fd
2 changed files with 46 additions and 2 deletions
7
base.php
7
base.php
|
@ -940,8 +940,10 @@ abstract class Base
|
|||
}
|
||||
|
||||
private static function error () {
|
||||
header("location: checkconfig.php?err=1");
|
||||
exit();
|
||||
if (php_sapi_name() != "cli") {
|
||||
header("location: checkconfig.php?err=1");
|
||||
}
|
||||
throw new Exception('Database not found.');
|
||||
}
|
||||
|
||||
public static function getDb ($database = NULL) {
|
||||
|
@ -968,6 +970,7 @@ abstract class Base
|
|||
} else {
|
||||
self::getDb ();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function clearDb () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue