Warn if setting up CDBI without DSN.
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@280
48953598-375a-da11-a14b-
00016c27c3ee
my $caller = caller(0);
no strict 'refs';
push @{"${caller}::ISA"}, $self;
my $caller = caller(0);
no strict 'refs';
push @{"${caller}::ISA"}, $self;
- foreach (@plugins) {
- if (/^\-Setup$/) { $caller->setup }
+ my $autosetup=0;
+ foreach (sort @plugins) {
+ if (/^\-Setup$/) { $autosetup++; }
elsif (/^\-Debug$/) {
*{"$caller\::debug"} = sub { 1 };
warn "Debugging enabled";
}
elsif (/^-.*$/) { warn "Unknown flag: $_" }
else {
elsif (/^\-Debug$/) {
*{"$caller\::debug"} = sub { 1 };
warn "Debugging enabled";
}
elsif (/^-.*$/) { warn "Unknown flag: $_" }
else {
# The plugin caller should be our application class
eval "package $caller; require Maypole::Plugin::$_";
if ($@) { warn qq(Loading plugin "Maypole::Plugin::$_" failed: $@) }
# The plugin caller should be our application class
eval "package $caller; require Maypole::Plugin::$_";
if ($@) { warn qq(Loading plugin "Maypole::Plugin::$_" failed: $@) }
+ $caller->setup() if $autosetup;
}
if ( $ENV{MOD_PERL} ) {
}
if ( $ENV{MOD_PERL} ) {
$p ||= $config->pass;
$opts ||= $config->opts;
$config->dsn($dsn);
$p ||= $config->pass;
$opts ||= $config->opts;
$config->dsn($dsn);
+ warn "No DSN set in config" unless $dsn;
$config->loader || $config->loader(
Class::DBI::Loader->new(
namespace => $namespace,
$config->loader || $config->loader(
Class::DBI::Loader->new(
namespace => $namespace,