]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC.pm
Apache2::MVC, Maypole::Application, parse_args() and much more...
[maypole.git] / lib / Apache / MVC.pm
index 21071de5950e5181185ed820bb7e85e86b525772..5005effb96f244fa0eaeae8526fc64d146160b80 100644 (file)
@@ -1,41 +1,24 @@
 package Apache::MVC;
-use base 'Maypole';
+
+use base qw(Apache::MVC::Base Maypole);
 use Apache;
 use Apache::Request;
 use strict;
 use warnings;
+
 our $VERSION = "0.3";
 
 sub get_request {
-    shift->{ar} = Apache::Request->new(Apache->request);
+    shift->{ar} = Apache::Request->new( Apache->request );
 }
 
-sub parse_location {
+sub parse_args {
     my $self = shift;
-    $self->{path} = $self->{ar}->uri;
-    my $loc = $self->{ar}->location;
-    no warnings 'uninitialized';
-    $self->{path} =~ s/^($loc)?\///;
-    $self->parse_path;
-
     $self->{params} = { $self->{ar}->content };
-    while (my ($key, $value) = each %{$self->{params}}) {
-      $self->{params}{$key} = '' unless defined $value;
+    while ( my ( $key, $value ) = each %{ $self->{params} } ) {
+        $self->{params}{$key} = '' unless defined $value;
     }
-    $self->{query}  = { $self->{ar}->args };
-}
-
-sub send_output {
-    my $r = shift;
-    $r->{ar}->content_type($r->{content_type});
-    $r->{ar}->headers_out->set("Content-Length" => length $r->{output});
-    $r->{ar}->send_http_header;
-    $r->{ar}->print($r->{output});
-}
-
-sub get_template_root {
-    my $r = shift;
-    $r->{ar}->document_root . "/". $r->{ar}->location;
+    $self->{query} = { $self->{ar}->args };
 }
 
 1;
@@ -130,6 +113,7 @@ see L<Maypole>.
 =head1 AUTHOR
 
 Simon Cozens, C<simon@cpan.org>
+Screwed up by Sebastian Riedel, C<sri@oook.de>
 
 =head1 LICENSE