Use Vroom::Conf::get_conf() in scripts

This commit is contained in:
Daniel Berteaud 2015-06-19 15:05:33 +02:00
parent 53975723bd
commit 4ae712f060
2 changed files with 6 additions and 16 deletions

View File

@ -6,15 +6,11 @@ use strict;
use File::Basename;
use lib dirname($0) . '/../lib';
use DBI;
use Config::Simple;
use Vroom::Constants;
use Vroom::Conf;
use utf8;
# Load and parse global config file
my $cfg = new Config::Simple();
$cfg->read(dirname($0) . '/../conf/settings.ini');
my $config = $cfg->vars();
my $config = Vroom::Conf::get_conf();
# Open a handle to the database server
my $dbh = DBI->connect(

View File

@ -2,19 +2,13 @@
use strict;
use warnings;
use Config::Simple;
use File::Basename;
use lib dirname($0) . '/../lib';
use Vroom::Conf;
my $dir=dirname($0);
chdir $dir . '/..';
chdir dirname($0) . '/..';
my $cfg = new Config::Simple();
$cfg->read('conf/settings.ini');
our $config = $cfg->vars();
$config->{'daemon.listen_ip'} ||= '127.0.0.1';
$config->{'daemon.listen_port'} ||= '8090';
$config->{'daemon.backend'} ||= 'hypnotoad';
my $config = Vroom::Conf::get_conf();
$ENV{'PERL5LIB'} = 'lib';