use Config::Any;
use NEXT;
use Data::Visitor::Callback;
+use Catalyst::Utils ();
-our $VERSION = '0.14';
+our $VERSION = '0.16';
=head1 NAME
=item * C<$ENV{ MYAPP_CONFIG }>
+=item * C<$ENV{ CATALYST_CONFIG }>
+
=item * C<$c-E<gt>config-E<gt>{ file }>
=item * C<$c-E<gt>path_to( $application_prefix )>
my $c = shift;
my $appname = ref $c || $c;
my $prefix = Catalyst::Utils::appprefix( $appname );
- my $path = $ENV{ Catalyst::Utils::class2env( $appname ) . '_CONFIG' }
+ my $path = Catalyst::Utils::env_value( $c, 'CONFIG' )
|| $c->config->{ file }
|| $c->path_to( $prefix );
=over 4
-=item * C<$ENV{ CATALYST_CONFIG_LOCAL_SUFFIX }>
-
=item * C<$ENV{ MYAPP_CONFIG_LOCAL_SUFFIX }>
+=item * C<$ENV{ CATALYST_CONFIG_LOCAL_SUFFIX }>
+
=item * C<$c-E<gt>config-E<gt>{ config_local_suffix }>
=back
sub get_config_local_suffix {
my $c = shift;
my $appname = ref $c || $c;
- my $suffix = $ENV{ CATALYST_CONFIG_LOCAL_SUFFIX }
- || $ENV{ Catalyst::Utils::class2env( $appname ) . '_CONFIG_LOCAL_SUFFIX' }
+ my $suffix = Catalyst::Utils::env_value( $c, 'CONFIG_LOCAL_SUFFIX' )
|| $c->config->{ config_local_suffix }
|| 'local';
my $v = Data::Visitor::Callback->new(
plain_value => sub {
return unless defined $_;
- s{__HOME__}{ $c->path_to( '' ) }e;
- s{__path_to\((.+)\)__}{ $c->path_to( split( '/', $1 ) ) }e;
+ s{__HOME__}{ $c->path_to( '' ) }eg;
+ s{__path_to\((.+?)\)__}{ $c->path_to( split( '/', $1 ) ) }eg;
}
);
$v->visit( $c->config );