forked from lix-project/hydra
Apply requested changes to Config.pm
This commit is contained in:
parent
4f95774ca3
commit
173ecb5d92
|
@ -6,7 +6,6 @@ use parent 'Catalyst';
|
|||
use Moose;
|
||||
use Hydra::Plugin;
|
||||
use Hydra::Model::DB;
|
||||
use Hydra::Config;
|
||||
use Catalyst::Runtime '5.70';
|
||||
use Catalyst qw/ConfigLoader
|
||||
Unicode::Encoding
|
||||
|
@ -51,7 +50,7 @@ __PACKAGE__->config(
|
|||
},
|
||||
'Plugin::ConfigLoader' => {
|
||||
driver => {
|
||||
'General' => \%configGeneralOpts
|
||||
'General' => \%Hydra::Config::configGeneralOpts
|
||||
}
|
||||
},
|
||||
'Plugin::PrometheusTiny' => {
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
package Hydra::Config;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(%configGeneralOpts);
|
||||
|
||||
my %configGeneralOpts = (-UseApacheInclude => 1, -IncludeAgain => 1);
|
||||
our %configGeneralOpts = (-UseApacheInclude => 1, -IncludeAgain => 1, -IncludeRelative => 1);
|
||||
|
||||
1;
|
||||
|
|
|
@ -42,14 +42,14 @@ my $hydraConfig;
|
|||
sub getHydraConfig {
|
||||
return $hydraConfig if defined $hydraConfig;
|
||||
my $conf = $ENV{"HYDRA_CONFIG"} || (Hydra::Model::DB::getHydraPath . "/hydra.conf");
|
||||
my %opts = (%Hydra::Config::configGeneralOpts, -ConfigFile => $conf);
|
||||
if (-f $conf) {
|
||||
|
||||
# Please keep these options in sync with corresponding
|
||||
# `Catalyst::Plugin::ConfigLoader` configuration in `Hydra.pm`
|
||||
# This is necessary in order to maintain consistent interpretation
|
||||
# of the config by the various hydra components.
|
||||
my %h = new Config::General( -ConfigFile => $conf
|
||||
, %configGeneralOpts )->getall;
|
||||
my %h = new Config::General(%opts)->getall;
|
||||
|
||||
$hydraConfig = \%h;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue