X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=1665ca702573c60c9fbd9ae4a892956e72e64061;hb=271fd90b8a1b9f843853601a75a1334407ff87c4;hp=7c9a8462eb7fb7237ef8713b0e7c34bcdbc88cf0;hpb=3c53e0b127e3f369a252bec0e4580567f6e85f2a;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index 7c9a846..1665ca7 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -6,12 +6,13 @@ use warnings; use Maypole::Config; use Maypole::Constants; -our $VERSION = '2.01'; +our $VERSION = '2.05'; __PACKAGE__->mk_classdata($_) for qw( config init_done view_object ); __PACKAGE__->mk_accessors( qw( ar params query objects model_class template_args output path - args action template error document_encoding content_type table) + args action template error document_encoding content_type table + extra_headers ) ); __PACKAGE__->config( Maypole::Config->new() ); __PACKAGE__->init_done(0); @@ -23,6 +24,7 @@ sub setup { $calling_class = ref $calling_class if ref $calling_class; { no strict 'refs'; + no warnings 'redefine'; # Naughty. *{ $calling_class . "::handler" } = @@ -48,7 +50,7 @@ sub init { $config->view->require; die "Couldn't load the view class " . $config->view . ": $@" if $@; $config->display_tables - || $config->display_tables( [ $class->config->tables ] ); + || $config->display_tables( $class->config->tables ); $class->view_object( $class->config->view->new ); $class->init_done(1); @@ -59,7 +61,7 @@ sub handler { # See Maypole::Workflow before trying to understand this. my ( $class, $req ) = @_; $class->init unless $class->init_done; - my $r = bless { config => $class->config }, $class; + my $r = bless { template_args => {}, config => $class->config }, $class; $r->get_request($req); $r->parse_location(); my $status = $r->handler_guts(); @@ -72,6 +74,7 @@ sub handler { sub handler_guts { my $r = shift; $r->model_class( $r->config->model->class_of( $r, $r->{table} ) ); + my $applicable = $r->is_applicable; unless ( $applicable == OK ) { @@ -274,6 +277,10 @@ A list of remaining parts of the request path after table and action have been removed +=head3 extra_headers + +A hash containing extra headers to be set on a request. + =head3 parse_args Turns post data and query string paramaters into a hash of C. @@ -441,8 +448,8 @@ Simon Cozens, C =head1 THANKS TO Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus Ramberg, -Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've -helped. +Mickael Joanne, Randal Schwartz, Simon Flack, Steve Simms, Veljko Vidovic +and all the others who've helped. =head1 LICENSE