X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FApache%2FMVC.pm;h=5005effb96f244fa0eaeae8526fc64d146160b80;hb=e1058b36db231a58f819075b0e5658a872e94f11;hp=21071de5950e5181185ed820bb7e85e86b525772;hpb=fb132e6828e038d5b7f58f28af702a67f8e05d09;p=maypole.git diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 21071de..5005eff 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -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. =head1 AUTHOR Simon Cozens, C +Screwed up by Sebastian Riedel, C =head1 LICENSE