Refactor the use of Calibre path to prepare multi database. re #40
This commit is contained in:
parent
f8f20f3d5c
commit
d86d544074
4 changed files with 17 additions and 7 deletions
16
base.php
16
base.php
|
@ -622,10 +622,20 @@ abstract class Base
|
|||
const COMPATIBILITY_XML_ALDIKO = "aldiko";
|
||||
|
||||
private static $db = NULL;
|
||||
|
||||
public static function getDbFileName () {
|
||||
|
||||
public static function getDbDirectory () {
|
||||
global $config;
|
||||
return $config['calibre_directory'] .'metadata.db';
|
||||
if (is_array ($config['calibre_directory'])) {
|
||||
$database = GetUrlParam ("database", 0);
|
||||
$array = array_values ($config['calibre_directory']);
|
||||
return $array[$database];
|
||||
}
|
||||
return $config['calibre_directory'];
|
||||
}
|
||||
|
||||
|
||||
public static function getDbFileName () {
|
||||
return self::getDbDirectory () .'metadata.db';
|
||||
}
|
||||
|
||||
public static function getDb () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue