mirror of
https://github.com/dani/vroom.git
synced 2024-06-29 15:03:41 +02:00
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 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…
Reference in New Issue
Block a user