Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Emmanuel QUEVILLON
BIGSdb
Commits
0001be38
Commit
0001be38
authored
Jun 16, 2016
by
horkko
Browse files
Merge branch 'config_dbconn' into develop
parents
346fcc6a
046350a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/BIGSdb/Application.pm
View file @
0001be38
...
...
@@ -187,10 +187,10 @@ sub _initiate {
$q
->
param
(
page
=>
'
index
'
)
if
!
defined
$q
->
param
('
page
');
$self
->
{'
page
'}
=
$q
->
param
('
page
');
$self
->
{'
system
'}
->
{'
read_access
'}
//
=
'
public
';
#everyone can view by default
$self
->
{'
system
'}
->
{'
host
'}
//
=
'
localhost
';
$self
->
{'
system
'}
->
{'
port
'}
//
=
5432
;
$self
->
{'
system
'}
->
{'
user
'}
//
=
'
apache
';
$self
->
{'
system
'}
->
{'
password
'}
//
=
'
remote
';
$self
->
{'
system
'}
->
{'
host
'}
//
=
$self
->
{'
config
'}
->
{'
dbhost
'}
//
=
'
localhost
';
$self
->
{'
system
'}
->
{'
port
'}
//
=
$self
->
{'
config
'}
->
{'
dbport
'}
//
=
5432
;
$self
->
{'
system
'}
->
{'
user
'}
//
=
$self
->
{'
config
'}
->
{'
dbuser
'}
//
=
'
apache
';
$self
->
{'
system
'}
->
{'
password
'}
//
=
$self
->
{'
config
'}
->
{'
dbpassword
'}
//
=
'
remote
';
$self
->
{'
system
'}
->
{'
privacy
'}
//
=
'
yes
';
$self
->
{'
system
'}
->
{'
privacy
'}
=
$self
->
{'
system
'}
->
{'
privacy
'}
eq
'
no
'
?
0
:
1
;
$self
->
{'
system
'}
->
{'
locus_superscript_prefix
'}
||=
'
no
';
...
...
@@ -345,6 +345,27 @@ sub read_config_file {
$self
->
{'
config
'}
->
{'
doclink
'}
//
=
'
http://bigsdb.readthedocs.io/en/latest
';
$self
->
{'
config
'}
->
{'
max_upload_size
'}
//
=
32
;
$self
->
{'
config
'}
->
{'
max_upload_size
'}
*=
1024
*
1024
;
$self
->
_read_db_config
(
$config_dir
);
return
;
}
sub
_read_db_config_file
{
my
(
$self
,
$config_dir
)
=
@_
;
my
$logger
=
get_logger
('
BIGSdb.Application_Initiate
');
my
$db_file
=
"
$config_dir
/db.conf
";
if
(
!
-
e
$db_file
){
return
;
}
my
$config
=
Config::
Tiny
->
new
();
$config
=
Config::
Tiny
->
read
("
$db_file
");
foreach
my
$param
(
qw (dbhost
dbuser
dbpassword
)
){
$self
->
{'
config
'}
->
{
$param
}
=
$config
->
{
_
}
->
{
$param
};
}
if
(
defined
$self
->
{'
config
'}
->
{'
dbport
'}
&&
!
BIGSdb::Utils::
is_int
(
$self
->
{'
config
'}
->
{'
dbport
'}
)
){
$logger
->
error
("
Parameter dbport in db.conf should be an integer - default value used.
");
undef
$self
->
{'
config
'}
->
{'
dbport
'};
}
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment