]> git.decadent.org.uk Git - maypole.git/blob - lib/Maypole/Application.pm
Zero search fix and sweet new templates, wheee...
[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 - Maypole Universal Frontend
31
32 =head1 SYNOPSIS
33
34     use Maypole::Application;
35
36 =head1 DESCRIPTION
37
38 This is a universal frontend for mod_perl1, mod_perl2 and CGI.
39
40 You can omit the Maypole:: prefix from plugins.
41 So Maypole::Config::YAML becomes Config::YAML.
42
43     use Maypole::Application qw(Config::YAML);
44
45 =head1 AUTHOR
46
47 Sebastian Riedel, C<sri@oook.de>
48 Idea by Marcus Ramberg, C<marcus@thefeed.no>
49
50 =head1 LICENSE
51
52 You may distribute this code under the same terms as Perl itself.