mirror of https://github.com/dani/vroom.git
Use Vroom::Conf::get_conf() in scripts
This commit is contained in:
parent
53975723bd
commit
4ae712f060
|
@ -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(
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Reference in New Issue