From: Sebastian Riedel Date: Fri, 15 Oct 2004 22:01:22 +0000 (+0000) Subject: Some warnings for easier debugging X-Git-Tag: 2.10~129 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5f175450fcaf2b71f910742abc16ede9bfdc7103;p=maypole.git Some warnings for easier debugging git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@233 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole.pm b/lib/Maypole.pm index e4c0f73..88110ea 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -63,6 +63,7 @@ sub handler { my $r = bless { config => $class->config }, $class; $r->get_request($req); $r->parse_location(); + warn "Request path: $r->{path}" if $r->debug; my $status = $r->handler_guts(); return $status unless $status == OK; $r->send_output; diff --git a/lib/Maypole/Application.pm b/lib/Maypole/Application.pm index 130eea0..a39c4a1 100644 --- a/lib/Maypole/Application.pm +++ b/lib/Maypole/Application.pm @@ -10,15 +10,18 @@ sub import { my $caller = caller(0); no strict 'refs'; push @{"${caller}::ISA"}, $self; - "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins); + foreach (@plugins) { + "Maypole::$_"->require or warn qq(Loading plugin "Maypole::$_" failed); + unshift @ISA, "Maypole::$_"; + } } if ( $ENV{MOD_PERL} ) { - require Apache::MVC; + require Apache::MVC or die 'Loading Apache frontend failed'; push @ISA, qw(Apache::MVC); } else { - require CGI::Maypole; + require CGI::Maypole or die 'Loading CGI frontend failed'; push @ISA, qw(CGI::Maypole); } diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index f409fff..b4208e1 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -223,6 +223,8 @@ sub setup_database { ); $config->{classes} = [ $config->{loader}->classes ]; $config->{tables} = [ $config->{loader}->tables ]; + warn( 'Loaded tables: ' . join ',', @{ $config->{tables} } ) + if $namespace->debug; } sub class_of { @@ -231,4 +233,3 @@ sub class_of { } 1; -