forked from lix-project/hydra
Hydra now uses an optional HYDRA_DBI environment variable which holds the DBI url. If this variable is not set, sqlite is used like before.
This commit is contained in:
parent
d774cd6f18
commit
a509694220
|
@ -65,10 +65,16 @@ sub getHydraPath {
|
||||||
|
|
||||||
|
|
||||||
sub getHydraDBPath {
|
sub getHydraDBPath {
|
||||||
|
my $db = $ENV{"HYDRA_DBI"};
|
||||||
|
if ($db ne "") {
|
||||||
|
return $db ;
|
||||||
|
}
|
||||||
|
else {
|
||||||
my $path = getHydraPath . '/hydra.sqlite';
|
my $path = getHydraPath . '/hydra.sqlite';
|
||||||
die "The Hydra database ($path) not exist!\n" unless -f $path;
|
die "The Hydra database ($path) not exist!\n" unless -f $path;
|
||||||
return "dbi:SQLite:$path";
|
return "dbi:SQLite:$path";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub openHydraDB {
|
sub openHydraDB {
|
||||||
|
|
Loading…
Reference in a new issue