| @@ 79-90 (lines=12) @@ | ||
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | public static function getDbName($database = NULL) |
|
| 80 | { |
|
| 81 | global $config; |
|
| 82 | if (self::isMultipleDatabaseEnabled()) { |
|
| 83 | if (is_null($database)) $database = GetUrlParam(DB, 0); |
|
| 84 | if (!is_null($database) && !preg_match('/^\d+$/', $database)) { |
|
| 85 | self::error($database); |
|
| 86 | } |
|
| 87 | $array = array_keys($config['calibre_directory']); |
|
| 88 | return $array[$database]; |
|
| 89 | } |
|
| 90 | return ''; |
|
| 91 | } |
|
| 92 | ||
| 93 | public static function getDbDirectory($database = NULL) |
|
| @@ 93-104 (lines=12) @@ | ||
| 90 | return ''; |
|
| 91 | } |
|
| 92 | ||
| 93 | public static function getDbDirectory($database = NULL) |
|
| 94 | { |
|
| 95 | global $config; |
|
| 96 | if (self::isMultipleDatabaseEnabled()) { |
|
| 97 | if (is_null($database)) $database = GetUrlParam(DB, 0); |
|
| 98 | if (!is_null($database) && !preg_match('/^\d+$/', $database)) { |
|
| 99 | self::error($database); |
|
| 100 | } |
|
| 101 | $array = array_values($config['calibre_directory']); |
|
| 102 | return $array[$database]; |
|
| 103 | } |
|
| 104 | return $config['calibre_directory']; |
|
| 105 | } |
|
| 106 | ||
| 107 | public static function getDbFileName($database = NULL) |
|