Navigation Menu

Skip to content

Commit

Permalink
Import of VVELOX/ZConf-2.0.1 from CPAN.
Browse files Browse the repository at this point in the history
gitpan-cpan-distribution: ZConf
gitpan-cpan-version:      2.0.1
gitpan-cpan-path:         VVELOX/ZConf-2.0.1.tar.gz
gitpan-cpan-author:       VVELOX
gitpan-cpan-maturity:     released
  • Loading branch information
VVelox authored and Gitpan committed Oct 21, 2014
1 parent e8b0ada commit e2053fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Changes
@@ -1,5 +1,9 @@
Revision history for ZConf

2.0.1 2009-11-26/8:00
-If a override chooser is not present, the override method just
returns 1.

2.0.0 2009-11-23/20:00
-the writeFromHash functions now use ZML instead of creating
them manually. This makes it more robust as it is easier
Expand Down
Empty file added bin/.exists
Empty file.
18 changes: 13 additions & 5 deletions lib/ZConf.pm
Expand Up @@ -17,11 +17,11 @@ ZConf - A configuration system allowing for either file or LDAP backed storage.
=head1 VERSION
Version 2.0.0
Version 2.0.1
=cut

our $VERSION = '2.0.0';
our $VERSION = '2.0.1';

=head1 SYNOPSIS
Expand Down Expand Up @@ -2820,6 +2820,9 @@ set as a regular variable.
One arguement is taken and it is a hash.
If a value of undef is returned, but no error is set, no
'#!zconf=override/chooser' is not defined.
=head3 args hash
=head4 config
Expand Down Expand Up @@ -2873,22 +2876,27 @@ sub override{

#if no profile is given, get one
if (!defined( $args{profile} )) {
if ( (defined( $self->{meta}{$args{config}}{zconf} ))&&(defined( $self->{meta}{$args{config}}{zconf}{'override/chooser'} )) ) {
my $chooser=$self->{meta}{$args{config}}{zconf}{'override/chooser'};
if ( (defined( $self->{meta}{$args{config}}{zconf} ))&&
(defined( $self->{meta}{$args{config}}{zconf}{'override/chooser'} ))
) {

my $chooser=$self->{meta}{$args{config}}{zconf}{'override/chooser'};
#if the chooser is not blank, run it
if ($chooser ne '') {
my ($success, $choosen)=choose($chooser);

#if no choosen name is returned, use 'default'
if (defined($choosen)) {
if ($success) {
$args{profile}=$choosen;
}else {
$args{profile}='default';
}
}else {
$args{profile}='default';
}
}else {
#none to process
return undef;
}
}

Expand Down

0 comments on commit e2053fc

Please sign in to comment.