Apply requested changes to Config.pm

This commit is contained in:
Shay Bergmann 2021-07-26 17:11:21 +00:00
parent 4f95774ca3
commit 173ecb5d92
No known key found for this signature in database
GPG key ID: 9B31F845AB291324
3 changed files with 4 additions and 11 deletions

View file

@ -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' => {

View file

@ -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;

View file

@ -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 {