- added Maypole::Application universal loader
- config parameter handling for Maypole::Model::CDBI
- $r->{query} is now deprecated, use $r->{params} for GET and POST
+ - fixed multiple value handling (Simon Flack)
1.7 Sat Jul 17 20:15:26 BST 2004
- Emergency release - we lost the "use Maypole::Constants" from
our $VERSION = "0.3";
sub run {
- my $self = shift;
- return $self->handler();
+ my $self = shift;
+ return $self->handler();
}
sub get_request {
- require CGI::Simple;
- shift->{cgi} = CGI::Simple->new();
+ require CGI::Simple;
+ shift->{cgi} = CGI::Simple->new();
}
sub parse_location {
- my $self = shift;
- $self->{path} = $self->{cgi}->url(-absolute=>1, -path_info=>1);
- my $loc = $self->{cgi}->url(-absolute=>1);
- no warnings 'uninitialized';
- $self->{path} =~ s/^($loc)?\///;
- $self->parse_path;
- $self->parse_args;
+ my $self = shift;
+ $self->{path} = $self->{cgi}->url( -absolute => 1, -path_info => 1 );
+ my $loc = $self->{cgi}->url( -absolute => 1 );
+ no warnings 'uninitialized';
+ $self->{path} =~ s/^($loc)?\///;
+ $self->parse_path;
+ $self->parse_args;
}
sub parse_args {
- my $self = shift;
- $self->{params} = { $self->{cgi}->Vars };
- $self->{query} = { $self->{cgi}->Vars };
+ my $self = shift;
+ my (%vars) = $self->{cgi}->Vars;
+ while ( my ( $key, $value ) = each %vars ) {
+ my @values = split "\0", $value;
+ $vars{$key} = @values == 1 ? $values[0] : \@values;
+ }
+ $self->{params} = {%vars};
+ $self->{query} = {%vars};
}
sub send_output {
- my $r = shift;
- print $r->{cgi}->header(-type => $r->{content_type},
- -content_length => length $r->{output},
- );
- print $r->{output};
+ my $r = shift;
+ print $r->{cgi}->header(
+ -type => $r->{content_type},
+ -content_length => length $r->{output},
+ );
+ print $r->{output};
}
sub get_template_root {
- my $r = shift;
- $r->{cgi}->document_root . "/". $r->{cgi}->url(-relative=>1);
+ my $r = shift;
+ $r->{cgi}->document_root . "/" . $r->{cgi}->url( -relative => 1 );
}
-
1;
=head1 NAME