Mojolicious-Plugin-MultiConfig
view release on metacpan or search on metacpan
lib/Mojolicious/Plugin/MultiConfig.pm view on Meta::CPAN
Register as a plugin and load config files. Called automatically by C<$app-E<gt>plugin>
=cut
sub register
{
my $self = shift;
my $app = shift;
my $arg = shift;
my $config = {};
my $username = (getpwuid($<))[0]; # TODO: Not on Windows!
my @files;
# Default args if not set
$arg->{moniker} //= $app->moniker;
$arg->{mode} //= $app->mode;
$arg->{dir} //= catfile($app->home, 'conf');
$arg->{files} //= ['%a.%e', '%a.%m.%e', '%a.%m.%u.%e'];
$arg->{ext} //= 'conf';
for (my $i = 0; $i < @{$arg->{files}}; $i++) {
( run in 0.452 second using v1.01-cache-2.11-cpan-8d75d55dd25 )