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