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

master
Daniel Berteaud 10 years ago
parent 53975723bd
commit 4ae712f060
  1. 8
      scripts/db_upgrade.pl
  2. 14
      scripts/start_server.pl

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

@ -2,19 +2,13 @@
use strict; use strict;
use warnings; use warnings;
use Config::Simple;
use File::Basename; use File::Basename;
use lib dirname($0) . '/../lib';
use Vroom::Conf;
my $dir=dirname($0); chdir dirname($0) . '/..';
chdir $dir . '/..';
my $cfg = new Config::Simple(); my $config = Vroom::Conf::get_conf();
$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';
$ENV{'PERL5LIB'} = 'lib'; $ENV{'PERL5LIB'} = 'lib';

Loading…
Cancel
Save