-if ( $ENV{MOD_PERL} ) {
- require mod_perl;
- if ( $mod_perl::VERSION >= 1.99 ) {
- require Apache2::MVC;
- our @ISA = qw(Apache2::MVC);
- }
- else {
- require Apache::MVC;
- our @ISA = qw(Apache::MVC);
+# funny little gimmick ;)
+my $banner = <<'';
+ __ __ _
+| \/ | __ _ _ _ _ __ ___ | | ___
+| |\/| |/ _` | | | | '_ \ / _ \| |/ _ \
+| | | | (_| | |_| | |_) | (_) | | __/
+|_| |_|\__,_|\__, | .__/ \___/|_|\___|
+ |___/|_| -= VERSION =-
+
+$banner =~ s/VERSION/$Maypole::VERSION/;
+warn $banner;
+
+our @ISA;
+
+sub import {
+ my ( $self, @plugins ) = @_;
+ my $caller = caller(0);
+ no strict 'refs';
+ push @{"${caller}::ISA"}, $self;
+ foreach (@plugins) {
+ if (/^\-Setup$/) { $caller->setup }
+ elsif (/^\-Debug$/) {
+ *{"$caller\::debug"} = sub { 1 };
+ warn "Debugging enabled";
+ }
+ else {
+
+ # The plugin caller should be our application class
+ eval "package $caller; require Maypole::Plugin::$_";
+ if ($@) { warn qq(Loading plugin "Maypole::Plugin::$_" failed: $@) }
+ else {
+ warn "Loaded plugin: Maypole::Plugin::$_" if $caller->debug;
+ unshift @ISA, "Maypole::Plugin::$_";
+ }
+ }