From: Aaron Trevena Date: Wed, 13 Jun 2007 15:31:20 +0000 (+0000) Subject: added new attribute to Maypole::Config - request_options X-Git-Tag: 2.12~4 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=50801f50404838954238fb4a87d4df5dda50cd76;p=maypole.git added new attribute to Maypole::Config - request_options git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@570 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/Changes b/Changes index 3addc38..7a88357 100644 --- a/Changes +++ b/Changes @@ -29,6 +29,7 @@ For information about current developments and future releases, see: fix to redirect_request Fixed typo in _do_update_or_create (bug 26495) added new hook - preprocess_location + added new attribute to Maypole::Config - request_options 2.111 Mon 30 April 2007 - forked - see 2.111 changelog diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index dea64ff..a79c611 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -1,6 +1,6 @@ package Apache::MVC; -our $VERSION = '2.11'; +our $VERSION = '2.12'; use strict; use warnings; @@ -93,11 +93,12 @@ functionality. See L for these: sub get_request { my ($self, $r) = @_; + my $request_options = $self->config->request_options || {}; my $ar; if ($MODPERL2) { - $ar = eval {require Apache2::Request} ? Apache2::Request->new($r) : $r; + $ar = eval {require Apache2::Request} ? Apache2::Request->new($r,%{$request_options}) : $r; } - else { $ar = Apache::Request->instance($r); } + else { $ar = Apache::Request->instance($r,%{$request_options}); } $self->ar($ar); } diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index dda15fc..df75712 100644 --- a/lib/CGI/Maypole.pm +++ b/lib/CGI/Maypole.pm @@ -7,7 +7,7 @@ use CGI::Simple; use Maypole::Headers; use Maypole::Constants; -our $VERSION = '2.11'; +our $VERSION = '2.12'; __PACKAGE__->mk_accessors( qw/cgi/ ); @@ -71,9 +71,11 @@ functionality. See L for these: =cut -sub get_request -{ - shift->cgi( CGI::Simple->new ); +sub get_request { + my $self = shift; + my $request_options = $self->config->request_options || {}; + $CGI::Simple::POST_MAX = $request_options->{POST_MAX} if ($request_options->{POST_MAX}); + $self->cgi( CGI::Simple->new ); } =item parse_location diff --git a/lib/Maypole/Config.pm b/lib/Maypole/Config.pm index 3307f8f..2473986 100644 --- a/lib/Maypole/Config.pm +++ b/lib/Maypole/Config.pm @@ -11,7 +11,7 @@ our $VERSION = "1." . sprintf "%04d", q$Rev$ =~ /: (\d+)/; __PACKAGE__->mk_accessors( qw( view view_options uri_base template_root template_extension model loader display_tables ok_tables rows_per_page dsn user pass opts - application_name additional build_form_elements) + application_name additional build_form_elements request_options) ); # Should only be modified by model. @@ -124,6 +124,14 @@ Other options to the DBI connect call. Username to log into the database with. +=head3 build_form_elements + +Flag specifying whether to build metadata for form elements in factory templates + +=head3 request_options + +Hashref of options passed when creating cgi or apache request + =head2 Adding additional configuration data You can use the 'additional' attribute for stashing additional info, especially from additional_data method,