From 4ae712f06044bbfb8dd3f31c27ce8bab0f0d0412 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 19 Jun 2015 15:05:33 +0200 Subject: [PATCH] Use Vroom::Conf::get_conf() in scripts --- scripts/db_upgrade.pl | 8 ++------ scripts/start_server.pl | 14 ++++---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/scripts/db_upgrade.pl b/scripts/db_upgrade.pl index b376e71..1d79cf7 100644 --- a/scripts/db_upgrade.pl +++ b/scripts/db_upgrade.pl @@ -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( diff --git a/scripts/start_server.pl b/scripts/start_server.pl index ca47262..451aeac 100755 --- a/scripts/start_server.pl +++ b/scripts/start_server.pl @@ -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';