]> git.decadent.org.uk Git - maypole.git/blob - lib/Maypole/Application.pm
b6789a835c229cf3db7f501ff5626570532d3bf9
[maypole.git] / lib / Maypole / Application.pm
1 package Maypole::Application;
2
3 use strict;
4 use warnings;
5
6 our @ISA;
7
8 sub import {
9     my ( $self, @plugins ) = @_;
10      return unless $plugins[0];
11      my $caller=caller(0);
12      no strict 'refs';
13      push @{"${caller}::ISA"}, $self;    
14      "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins);
15 }
16
17 if ( $ENV{MOD_PERL} ) {
18     require Apache::MVC;
19     push @ISA , qw(Apache::MVC);
20 }
21 else {
22     require CGI::Maypole;
23     push @ISA , qw(CGI::Maypole);
24 }
25
26 1;
27
28 =head1 NAME
29
30 Maypole::Application - all in wonder front-end
31
32 =head1 SYNOPSIS
33
34     use base 'Maypole::Application';
35
36 =head1 DESCRIPTION
37
38 The all in wonder front-end.
39
40 =head1 AUTHOR
41
42 Sebastian Riedel, C<sri@oook.de>
43 Idea by Marcus Ramberg, C<marcus@thefeed.no>
44
45 =head1 LICENSE
46
47 You may distribute this code under the same terms as Perl itself.