-__PACKAGE__->mk_classdata(qw( _config init_done view_object ));
-__PACKAGE__->mk_accessors ( qw( config ar params objects model_class args ));
-__PACKAGE__->config({});
-__PACKAGE__->init_done(0);
+use base 'Maypole';
+use Maypole::Headers;
+use Maypole::Constants;
+
+__PACKAGE__->mk_accessors( qw( ar ) );
+
+our $MODPERL2;
+our $modperl_version;
+
+BEGIN {
+ eval 'use Apache;';
+ if ($@) {
+ eval 'use mod_perl2; $modperl_version = $mod_perl2::VERSION; ';
+ if ($@) {
+ $modperl_version = $Apache2::RequestRec::VERSION;
+ }
+ require Apache2::RequestIO;
+ require Apache2::RequestRec;
+ require Apache2::RequestUtil;
+ require APR::URI;
+ require HTTP::Body;
+ $MODPERL2 = 1;
+ } else {
+ eval ' use mod_perl; ';
+ require Apache;
+ require Apache::Request;
+ $MODPERL2 = 0;
+ $modperl_version = 1;
+ }
+
+}
+
+=head1 NAME
+
+Apache::MVC - Apache front-end to Maypole
+
+=head1 SYNOPSIS
+
+ package BeerDB;
+ use Maypole::Application;
+
+=head1 DESCRIPTION
+
+A mod_perl platform driver for Maypole. Your application can inherit from
+Apache::MVC directly, but it is recommended that you use
+L<Maypole::Application>.
+
+=head1 INSTALLATION
+
+Create a driver module like the one illustrated in L<Maypole::Application>.
+
+Put the following in your Apache config:
+
+ <Location /beer>
+ SetHandler perl-script
+ PerlHandler BeerDB
+ </Location>