]> git.decadent.org.uk Git - maypole.git/blob - lib/Maypole/Application.pm
small fix for Maypole::Application
[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     my $caller = caller(0);
11     no strict 'refs';
12     push @{"${caller}::ISA"}, $self;
13     "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins);
14 }
15
16 if ( $ENV{MOD_PERL} ) {
17     require Apache::MVC;
18     push @ISA, qw(Apache::MVC);
19 }
20 else {
21     require CGI::Maypole;
22     push @ISA, qw(CGI::Maypole);
23 }
24
25 1;
26
27 =head1 NAME
28
29 Maypole::Application - Maypole Universal Frontend
30
31 =head1 SYNOPSIS
32
33     use Maypole::Application;
34
35 =head1 DESCRIPTION
36
37 This is a universal frontend for mod_perl1, mod_perl2 and CGI.
38
39 You can omit the Maypole:: prefix from plugins.
40 So Maypole::Config::YAML becomes Config::YAML.
41
42     use Maypole::Application qw(Config::YAML);
43
44 =head1 AUTHOR
45
46 Sebastian Riedel, C<sri@oook.de>
47 Idea by Marcus Ramberg, C<marcus@thefeed.no>
48
49 =head1 LICENSE
50
51 You may distribute this code under the same terms as Perl itself.