X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FApplication.pm;h=b6789a835c229cf3db7f501ff5626570532d3bf9;hb=2225b4184a391bab5f1d9498d5b695ba0c2f09f2;hp=2727c9a062a7f5d5cc74319c7fa925feadf087fc;hpb=e1058b36db231a58f819075b0e5658a872e94f11;p=maypole.git diff --git a/lib/Maypole/Application.pm b/lib/Maypole/Application.pm index 2727c9a..b6789a8 100644 --- a/lib/Maypole/Application.pm +++ b/lib/Maypole/Application.pm @@ -3,20 +3,24 @@ package Maypole::Application; use strict; use warnings; +our @ISA; + +sub import { + my ( $self, @plugins ) = @_; + return unless $plugins[0]; + my $caller=caller(0); + no strict 'refs'; + push @{"${caller}::ISA"}, $self; + "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins); +} + 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); - } + require Apache::MVC; + push @ISA , qw(Apache::MVC); } else { require CGI::Maypole; - our @ISA = qw(CGI::Maypole); + push @ISA , qw(CGI::Maypole); } 1;