Factorize a little more the DB handling. re #127

This commit is contained in:
Sébastien Lucas 2013-12-14 18:25:32 +01:00
parent 3df11c6ef7
commit cd626b25ef
3 changed files with 24 additions and 13 deletions

View file

@ -33,16 +33,7 @@
// Access the database ASAP to be sure it's readable, redirect if that's not the case.
// It has to be done before any header is sent.
if (Base::noDatabaseSelected ()) {
$i = 0;
foreach (array_keys ($config['calibre_directory']) as $key) {
$test = Base::getDb ($i);
Base::clearDb ();
$i++;
}
} else {
$test = Base::getDb ();
}
Base::checkDatabaseAvailability ();
if ($config ['cops_fetch_protect'] == "1") {
session_start();